Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions deep_disfluency/asr/ibm_watson.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def __init__(self, fake_stream):
self.fake_stream = fake_stream # a list of updates to be fired

def enter(self):
print "starting fake streaming"
print("starting fake streaming")

def exit(self):
print "finished fake streaming"
print("finished fake streaming")

def produce(self):
if len(self.fake_stream) > 0:
Expand Down Expand Up @@ -82,9 +82,9 @@ def clean_word(self, word):
return word

def is_new(self, start_time):
if len(self.memory.keys()) == 0:
if len(list(self.memory.keys())) == 0:
return True
last_update = sorted(self.memory.keys(), reverse=True)[0]
last_update = sorted(list(self.memory.keys()), reverse=True)[0]
return start_time >= self.memory[last_update]['end_time']

def get_id_if_update(self, start_time, end_time, word):
Expand All @@ -101,7 +101,7 @@ def get_id_if_update(self, start_time, end_time, word):
return None # a repeated word
update_id = None
update_start_times_to_revoke = []
for old_id in sorted(self.memory.keys(), reverse=True):
for old_id in sorted(list(self.memory.keys()), reverse=True):
if start_time >= self.memory[old_id]['end_time']:
# we've found the update
break
Expand Down Expand Up @@ -180,7 +180,7 @@ def get_id_if_update(self, start_time, end_time, word):
fluteline.connect(nodes)
fluteline.start(nodes)

print time.clock() - tic, "seconds"
print(time.clock() - tic, "seconds")

time.sleep(1)
fluteline.stop(nodes)
4 changes: 2 additions & 2 deletions deep_disfluency/corpus/BNC_create_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def main():
# load original bnc corpus file
orig_xml = safe_open(os.path.join(bnc_dir, filename + ".xml"), 'r')
except IOError:
print "NO file", filename + ".xml"
print("NO file", filename + ".xml")
continue
readXML_writeCorpus(orig_xml, new_file) # write to new file
print word_count
print(word_count)
if word_count > 20000000:
break
new_file.close()
Expand Down
Loading