Ver Fonte

fix data

root há 1 semana atrás
pai
commit
bd5e427750
2 ficheiros alterados com 170 adições e 796 exclusões
  1. 164 794
      ai-slibra-assistant/data/robot.json
  2. 6 2
      ai-slibra-assistant/util/utils.py

Diff do ficheiro suprimidas por serem muito extensas
+ 164 - 794
ai-slibra-assistant/data/robot.json


+ 6 - 2
ai-slibra-assistant/util/utils.py

@@ -159,7 +159,7 @@ CREATE TABLE botrecords (
                     asr = answer.get("option", [{}])[-1].get("asr", '')
                     code = answer.get("code")
                     opt = answer.get("option", {})
-                    if (code in ["1.10", "1.30"] and asr!="1") or (code == "1.00" and asr not in ["2", "1"]):
+                    if (code in ["1.10", "1.30"] and asr!="1") or (code == "1.00" and asr not in ["2", "1"]) or (code == "98.00" and intent=="others"):
                         if opt:
                             if opt[-1].get("subclass"):
                                 intent = opt[-1].get("subclass")
@@ -167,6 +167,10 @@ CREATE TABLE botrecords (
                                 intent = opt[-1].get("firstclass")
                             else:
                                 intent =opt[-1].get("title", '')
+                            if intent in ["未听清", "打招呼", "准备结束"]:
+                                intent = "未知意图"
+                            if intent == "":
+                                intent = "用户未说话"
                     elif code == "1.20":
                         tags = {"1": "1_停水咨询", "2":"1_漏水保修", "3":"1_户号查询","4":"1_水费查询", "5":"1_水价咨询","6":"1_水质水价保修", "7":"1_投诉建议", "0":"1_转人工"}
                         intent = tags.get(asr, "1_其他")
@@ -258,7 +262,7 @@ def norm_community(asr):
 
 
 if __name__ == "__main__":
-    asr="宝升三号楼"
+    asr="前进区水平社区宝升三号楼"
     print(f"asr:{asr}")
     loc = norm_community(asr)
     print(f"命中小区:{loc}")

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff