Naive Approach in Python Modul
This commit is contained in:
		| @ -17,7 +17,7 @@ import pprint | ||||
|  | ||||
|  | ||||
| # # Naive Approach | ||||
|  | ||||
| table = pd.read_csv('../Tools/emoji_descriptions.csv') | ||||
|  | ||||
| ####################### | ||||
| # Helper functions | ||||
| @ -79,7 +79,6 @@ def evaluate_sentence(sentence, table, description_key = 'description', lang = ' | ||||
| # emojis_to_consider can be either a list or "all" | ||||
| def prepareData(stemming=False, emojis_to_consider="all"): | ||||
|  | ||||
|     table = pd.read_csv('../Tools/emoji_descriptions.csv') | ||||
|     table.head() | ||||
|      | ||||
|     if(stemming): | ||||
| @ -95,10 +94,10 @@ def prepareData(stemming=False, emojis_to_consider="all"): | ||||
|  | ||||
|     emoji_set = set(emoji_set) | ||||
|      | ||||
|     return lookup, table | ||||
|     return lookup | ||||
|  | ||||
| # make a prediction for an input sentence | ||||
| def predict(sentence, lookup, table, emojis_to_consider="all", criteria="threshold", description_key='description', lang = 'eng', n=10, t=0.9): | ||||
| def predict(sentence, lookup, emojis_to_consider="all", criteria="threshold", description_key='description', lang = 'eng', n=10, t=0.9): | ||||
|  | ||||
|     result = evaluate_sentence(sentence, table, description_key, lang) | ||||
|      | ||||
|  | ||||
		Reference in New Issue
	
	Block a user