From ee7e72e300a0efd77ae16dd1712059681468e7e8 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Tue, 18 Mar 2025 21:15:05 +0100 Subject: [PATCH] Try to remove as much noise as possible within phi4 --- node-hub/dora-phi4/dora_phi4/main.py | 28 +++++++++++++++++++++- node-hub/dora-pyaudio/dora_pyaudio/main.py | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/node-hub/dora-phi4/dora_phi4/main.py b/node-hub/dora-phi4/dora_phi4/main.py index 676b9317..5f19c849 100644 --- a/node-hub/dora-phi4/dora_phi4/main.py +++ b/node-hub/dora-phi4/dora_phi4/main.py @@ -70,17 +70,39 @@ LEAD_MODALITY = os.getenv("LEAD_MODALITY", "text") BAD_SENTENCES = [ "The stock market closed down by 0.1%.", "The stock market closed down by 0.1 percent.", + "The stock market closed down by one.", + "The market is closed on Monday and Tuesday.", "The market is closed on Mondays and Tuesdays.", + "the first is the of the internet communicate people", "The first time I saw the movie, I was very impressed.", + "The first one is the one that is the most important.", + "The first one is the one that is the most common.", "The first time I saw the sea, I was very young.", "The first time I saw the sea was when I was a child.", "The sound of the wind is so loud.", "The first time I saw the sea.", + "the first time saw the sea i was so happy" "The first time I saw the sea was in the movie.", + "The first time I saw the movie was in the theater.", "The first time I saw the movie.", + "the first i saw the video i was very impressed", "the first time saw the video i was like my god", + "i am a student at the university of toronto", "I don't know what to do.", - "I don't know.", + "translator elisabeth buffard reviewer denise rq", + "Translator Elisabeth Buffard Reviewer Denise RQ.", + "Translator Denise RQ Reviewer Denise RQ.", + "the company also has a presence the united states canada brazil argentina mexico colombia peru chile uruguay", + "the company also has a presence the united states canada brazil mexico argentina colombia chile peru and uruguay", + "the company also has a presence the united states canada brazil argentina mexico and the united kingdom", + "the company also presence in the united states canada brazil argentina mexico colombia peru chile uruguay", + "The company also has a presence in the United States, Canada, Brazil, Argentina, Mexico, Colombia, Peru, Chile, and Uruguay." + "the company also has presence in the united states canada the united kingdom", + "company also has a presence the united states canada brazil argentina colombia mexico peru chile and uruguay", + "the company also has a presence the united states canada and the united kingdom", + "the company also announced that it will acquire the online retailer zappos", + "the company has a market capitalization of 15 trillion yen", + ] @@ -264,6 +286,10 @@ def main(): if response in BAD_SENTENCES: continue + if "company also has a presence" in response: + continue + elif "The first time I saw the" in response: + continue ## Remove text noise independently of casing response = remove_text_noise(response, text_noise) if response.strip() == "" or response.strip() == ".": diff --git a/node-hub/dora-pyaudio/dora_pyaudio/main.py b/node-hub/dora-pyaudio/dora_pyaudio/main.py index f11cb3f2..01dbb73c 100644 --- a/node-hub/dora-pyaudio/dora_pyaudio/main.py +++ b/node-hub/dora-pyaudio/dora_pyaudio/main.py @@ -41,7 +41,7 @@ def main(): sr = SAMPLE_RATE i = 0 while True: - event = node.next(timeout=0.01) + event = node.next(timeout=0.005) if event is None: break if event["type"] == "INPUT":