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
|
||||
"""
|
||||
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}
|
||||
|
||||
self.to_process = utterance
|
||||
|
|
|
@ -255,7 +255,7 @@ class ResponseGenerator:
|
|||
return self.gen_response(action="listCommands")
|
||||
|
||||
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']:
|
||||
if (entity['entity'] == 'TITLE'):
|
||||
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']))
|
||||
conn.commit()
|
||||
cur.close()
|
||||
|
||||
reply = jsonify({"status": "done"})
|
||||
return reply
|
||||
|
||||
|
@ -198,6 +199,7 @@ if __name__ == "__main__":
|
|||
|
||||
threading.Thread(target=vre_fetch, name='updatevre').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"))
|
||||
|
||||
cur = conn.cursor()
|
||||
|
@ -219,4 +221,5 @@ if __name__ == "__main__":
|
|||
)
|
||||
conn.commit()
|
||||
cur.close()
|
||||
|
||||
app.run(host='0.0.0.0')
|
||||
|
|
Loading…
Reference in New Issue