Skip to content

Commit 0abeed9

Browse files
author
Sean Trott
committed
useragent
1 parent 59f4388 commit 0abeed9

3 files changed

Lines changed: 4 additions & 48 deletions

File tree

speech.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/bash
22
python3 src/main/nluas/language/speechagent.py -asr=$asrdir
3+
4+
5+
#python src/main/nluas/language/speechagent.py -asr=/n/banquet/dc/seantrott/Desktop/models

src/main/nluas/language/speechagent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def __init__(self, asrdir='/t/janin/ecg/asr'):
9191

9292
# Path to where ASR models and other required files are stored.
9393
self.asrdir = asrdir
94+
print(asrdir)
9495

9596
# Make sure required files exist.
9697
for f in ('HCLG.fst', 'final.mdl', 'mfcc.conf', 'online_nnet2_decoding.conf', 'words.txt'):

src/main/nluas/language/user_agent.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,6 @@ def write_file(self, json_ntuple, msg):
182182
f = open(generated, "w")
183183
f.write(json_ntuple)
184184

185-
def prompt(self):
186-
while True:# and not self.clarification:
187-
#print(self.clarification)
188-
if self.clarification:
189-
pass
190-
else:
191-
specialize = True
192-
msg = input("> ")
193-
194-
if msg == "q":
195-
self.transport.quit_federation()
196-
quit()
197-
elif msg == None or msg == "":
198-
specialize = False
199-
elif msg.lower() == 'd':
200-
self.specializer.set_debug()
201-
specialize = False
202-
elif specialize:
203-
#if self.check_spelling(msg):
204-
ntuple = self.process_input(msg)
205-
if ntuple and ntuple != None and "predicate_type" in ntuple:
206-
self.transport.send(self.solve_destination, ntuple)
207185

208186

209187

@@ -212,32 +190,6 @@ def process_clarification(self, tag, msg, ntuple):
212190
#self.output_stream(tag, msg)
213191
new_ntuple = {'tag': tag, 'message': msg, 'type': "clarification", 'original': ntuple}
214192
self.transport.send(self.text_address, new_ntuple)
215-
"""
216-
#print(ntuple)
217-
while True:
218-
msg = input(" > ")
219-
#if msg == "q":
220-
# self.clarification = False
221-
# self.transport.quit_federation()
222-
if msg == "q":
223-
self.clarification = False
224-
break
225-
elif msg:
226-
try:
227-
first = self.process_input(msg)
228-
descriptor = json.loads(first)
229-
#print(descriptor)
230-
converted = self.decoder.convert_JSON_to_ntuple(ntuple)
231-
self.clarification = False
232-
new_ntuple = self.clarify_ntuple(converted, descriptor)
233-
json_ntuple = self.decoder.convert_to_JSON(new_ntuple)
234-
#json_ntuple = json.dumps(new_ntuple)
235-
self.transport.send(self.solve_destination, json_ntuple)
236-
self.clarification = False
237-
break
238-
except Exception as e:
239-
print(e)
240-
"""
241193

242194

243195
def clarify_ntuple(self, ntuple, descriptor):

0 commit comments

Comments
 (0)