aboutsummaryrefslogtreecommitdiffstats
path: root/agl_service_voiceagent/nlu/snips_interface.py
diff options
context:
space:
mode:
authorAnuj Solanki <anuj603362@gmail.com>2024-06-16 18:49:45 +0530
committerAnuj Solanki <anuj603362@gmail.com>2024-09-07 20:16:14 +0530
commit1144fcd343bc56f8c27ff73d3e76904010dbb832 (patch)
tree490915cd969f19b4eb3b3dd480554b27c1058243 /agl_service_voiceagent/nlu/snips_interface.py
parentf2b62ba4da5a178221c3210c2d468cd684e626cc (diff)
Integrate Whisper AI into agl-service-voiceagent
V1: - Integrated Whisper AI for speech-to-text functionality into agl-service-voiceagent. - Add support for both online and offline mode. - Implemented a gRPC-based connection for online mode between Whisper ASR service and voice-agent service. V2: - Update kuksa-interface - Add whisper-cpp for speech-to-text functionality - Add support to control media using mpd - Fix audio recorder Bug-AGL: SPEC-5200 Change-Id: I2661ae61ba2c3283bcfde26d6e4f498270240b19 Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
Diffstat (limited to 'agl_service_voiceagent/nlu/snips_interface.py')
-rw-r--r--agl_service_voiceagent/nlu/snips_interface.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/agl_service_voiceagent/nlu/snips_interface.py b/agl_service_voiceagent/nlu/snips_interface.py
index 1febe92..a32f574 100644
--- a/agl_service_voiceagent/nlu/snips_interface.py
+++ b/agl_service_voiceagent/nlu/snips_interface.py
@@ -13,7 +13,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
import re
from typing import Text
from snips_inference_agl import SnipsNLUEngine
@@ -47,6 +46,10 @@ class SnipsInterface:
preprocessed_text = text.lower().strip()
# remove special characters, punctuation, and extra whitespaces
preprocessed_text = re.sub(r'[^\w\s]', '', preprocessed_text).strip()
+ # replace % with " precent"
+ preprocessed_text = re.sub(r'%', ' percent', preprocessed_text)
+ # replace ° with " degrees"
+ preprocessed_text = re.sub(r'°', ' degrees ', preprocessed_text)
return preprocessed_text
def extract_intent(self, text: Text):