Add fuzzy and text-classification light model #1
					 2 changed files with 4 additions and 3 deletions
				
			
		Fixes
				commit
				
					
					
						7a756137dc
					
				
			
		
							
								
								
									
										1
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								main.py
									
										
									
									
									
								
							|  | @ -79,6 +79,7 @@ def run_prompt(): | ||||||
|     question = "empty" |     question = "empty" | ||||||
|     while question != "stop": |     while question != "stop": | ||||||
|         question = input("?") |         question = input("?") | ||||||
|  |         if question != "stop": | ||||||
|             print(answer(question)) |             print(answer(question)) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -60,7 +60,7 @@ class BertIntent(): | ||||||
|         classification = self.classifier(sentence) |         classification = self.classifier(sentence) | ||||||
| 
 | 
 | ||||||
|         if classification[0]["score"] < 0.7:  # score too low |         if classification[0]["score"] < 0.7:  # score too low | ||||||
|             return |             return {'intentName': ''} | ||||||
| 
 | 
 | ||||||
|         label = classification[0]["label"] |         label = classification[0]["label"] | ||||||
| 
 | 
 | ||||||
|  | @ -69,7 +69,7 @@ class BertIntent(): | ||||||
|         elif label == "DATE": |         elif label == "DATE": | ||||||
|             return {'intentName': 'GetDate'} |             return {'intentName': 'GetDate'} | ||||||
|         elif label == "ETEINDRE_CUISINE": |         elif label == "ETEINDRE_CUISINE": | ||||||
|             return {'intentName': 'GetTime', 'intentArg': ['cuisine']} |             return {'intentName': 'LightOff', 'intentArg': ['cuisine']} | ||||||
|         elif label == "ETEINDRE_BUREAU": |         elif label == "ETEINDRE_BUREAU": | ||||||
|             return {'intentName': 'LightOff', 'intentArg': ['bureau']} |             return {'intentName': 'LightOff', 'intentArg': ['bureau']} | ||||||
|         elif label == "ETEINDRE_SALON": |         elif label == "ETEINDRE_SALON": | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue