4

I was wondering if somebody could elaborate on the difference between trait, freetext and keywords as search strategies in wit.ai entities? I don't see that much about it on the docs and haven't been able to find anything about it elsewhere. Could somebody please give a few use cases of when each would be the best choice?

user3282276
  • 3,674
  • 8
  • 32
  • 48

1 Answers1

11

Trait: When the entity value is not inferred from a keyword or specific phrase in the sentence. There is no obvious association between certain words in the sentence and the value of the entity, but rather you need the sentence as a whole to determine the value.
Ex: Intent, Sentiment, Politeness

Free Text: When you need to extract a sub string of the message, and this sub string does not belong to a predefined list of possible values.
Ex: Message Body, Contact Name etc.

Keywords: When the entity value belongs to a predefined list, and you just need sub string matching to look it up in the sentence.
Ex: Country, Car Make, Colours, cuisines etc.

Ravi Teja
  • 377
  • 4
  • 15
  • And if I want to get the whole user entry, and I don't mind the meaning, because the whole entry is necessary to query the database. Should I create a custom field of type trait? – sgelves Mar 23 '17 at 22:52
  • @ruselli Can you elaborate more, an example would be better. – Ravi Teja Mar 24 '17 at 06:21
  • ok, so I have a database of questions titles, so the bot ask the user, type your question, then the user entry is used to get the best match in the database, but in case that there were not matches found, the entire question the user entered is going to be stored in db. – sgelves Mar 24 '17 at 13:43
  • oh, no intent should be created for this purpose. thank you. – sgelves Mar 24 '17 at 15:28