fix
This commit is contained in:
parent
35dfb21bf4
commit
93d36c7cc8
2
NLU.py
2
NLU.py
|
@ -88,7 +88,7 @@ class NLU:
|
||||||
"""
|
"""
|
||||||
Query -> coref resolution & intent extraction -> if intents are not confident or if query is ambig -> rewrite query and recheck -> if still ambig, ask a clarifying question
|
Query -> coref resolution & intent extraction -> if intents are not confident or if query is ambig -> rewrite query and recheck -> if still ambig, ask a clarifying question
|
||||||
"""
|
"""
|
||||||
if utterance in ["help", "list resources", "list papers", "list datasets", "list topics"]:
|
if utterance.lower() in ["help", "list resources", "list papers", "list datasets", "list topics"]:
|
||||||
return {"modified_query": utterance, "intent": "COMMAND", "entities": [], "is_offensive": False, "is_clear": True}
|
return {"modified_query": utterance, "intent": "COMMAND", "entities": [], "is_offensive": False, "is_clear": True}
|
||||||
|
|
||||||
self.to_process = utterance
|
self.to_process = utterance
|
||||||
|
|
|
@ -255,7 +255,7 @@ class ResponseGenerator:
|
||||||
return self.gen_response(action="listCommands")
|
return self.gen_response(action="listCommands")
|
||||||
|
|
||||||
elif action == "sumPaper":
|
elif action == "sumPaper":
|
||||||
if len(self.paper) == 0 or (len(self.paper) > 0 and len(state['entities'])>0)
|
if len(self.paper) == 0 or (len(self.paper) > 0 and len(state['entities'])>0):
|
||||||
for entity in state['entities']:
|
for entity in state['entities']:
|
||||||
if (entity['entity'] == 'TITLE'):
|
if (entity['entity'] == 'TITLE'):
|
||||||
paper = self._get_matching_titles('paper_db', entity['value'])
|
paper = self._get_matching_titles('paper_db', entity['value'])
|
||||||
|
|
3
main.py
3
main.py
|
@ -159,6 +159,7 @@ def feedback():
|
||||||
data['speed'], data['intent']))
|
data['speed'], data['intent']))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
cur.close()
|
cur.close()
|
||||||
|
|
||||||
reply = jsonify({"status": "done"})
|
reply = jsonify({"status": "done"})
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
|
@ -198,6 +199,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
threading.Thread(target=vre_fetch, name='updatevre').start()
|
threading.Thread(target=vre_fetch, name='updatevre').start()
|
||||||
threading.Thread(target=clear_inactive, name='clear').start()
|
threading.Thread(target=clear_inactive, name='clear').start()
|
||||||
|
|
||||||
conn = psycopg2.connect(host="janet-pg", database=os.getenv("POSTGRES_DB"), user=os.getenv("POSTGRES_USER"), password=os.getenv("POSTGRES_PASSWORD"))
|
conn = psycopg2.connect(host="janet-pg", database=os.getenv("POSTGRES_DB"), user=os.getenv("POSTGRES_USER"), password=os.getenv("POSTGRES_PASSWORD"))
|
||||||
|
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
@ -219,4 +221,5 @@ if __name__ == "__main__":
|
||||||
)
|
)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
cur.close()
|
cur.close()
|
||||||
|
|
||||||
app.run(host='0.0.0.0')
|
app.run(host='0.0.0.0')
|
||||||
|
|
Loading…
Reference in New Issue