LittleYenMin / jieba-bot

NLP implement by Chinese segmentation and cosine-similarity
3 stars 0 forks source link

Compare User input and questions by cosine-similarity #11

Open LittleYenMin opened 5 years ago

LittleYenMin commented 5 years ago
  1. Compare user input by jieba segmentation and cosine-similarity.
  2. return result like below. ref LUIS
{
   "query": "Book me a flight to Cairo",
   "topScoringIntent": {
       "intent": "BookFlight",
       "score": 0.9887482
   },
   "intents": [
       {
           "intent": "BookFlight",
           "score": 0.9887482
       },
       {
           "intent": "None",
           "score": 0.04272597
       },
       {
           "intent": "LocationFinder",
           "score": 0.0125702191
       },
       {
           "intent": "Reminder",
           "score": 0.00375502417
       },
       {
           "intent": "FoodOrder",
           "score": 3.765154E-07
       },
   ]
}

Note: the intent is the answers, and the score is the value of cosine-similarity.

LittleYenMin commented 5 years ago

WIP branch compare-input-with-questions