Skip to content

Commit

Permalink
Lina Travel Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
theamrzaki committed Jul 24, 2017
1 parent 870d5c6 commit d6d09bf
Show file tree
Hide file tree
Showing 3 changed files with 489 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Lina.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
import sklearn
import string

# ______Data Extraction_______
import data_extraction

# -----------------------------------$$ Global Variables $$-------------------------------------#
delimeter = "_+^$#*#$^+_"
dir = os.path.dirname(__file__)
Expand Down Expand Up @@ -489,9 +492,19 @@ def callBot(var, option):
tfidf_vectorizer_april_path_primary,
tfidf_matrix_train_april_path_primary)



if (response_primary != "null"):
return "message", (response_primary.capitalize().strip(), option, None)

#free the variables of parsing
data_extraction.tree_output_str =""
#data_extraction.tree_output =[]
respone_data_exctraction = data_extraction.data_extraction( var )
if (respone_data_exctraction != ""):
return "message", (respone_data_exctraction.capitalize().strip(), option, None)


result1 = extract_intents(var)
result2 = getAnswer(crop_intents(var))
response = ""
Expand Down Expand Up @@ -672,4 +685,5 @@ def get_relative_path(filename):
#to test offline
while 1:
chat_sentance = raw_input("Talk to Lina :")
callBot(chat_sentance , 13)
print callBot(chat_sentance , 0)
print
1 change: 1 addition & 0 deletions Lina.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="data_extraction.py" />
<Compile Include="filter.py" />
<Compile Include="Lina.py" />
<Compile Include="stat_parser\eval_parser.py" />
Expand Down
Loading

0 comments on commit d6d09bf

Please sign in to comment.