wit icon indicating copy to clipboard operation
wit copied to clipboard

Want to know best approach to train the bot

Open rlakhotiya opened this issue 6 years ago • 10 comments

Hello Team,

Want to know best approach to train the bot, when to use traits, free text and keywords?

Looking for hearing from the group.

rlakhotiya avatar Mar 16 '20 20:03 rlakhotiya

Hi @rlakhotiya,

You'll need to identify if the entity you want to train is a feature for the whole sentence, or just a span of text within a sentence. We use traits for the former (e.g. sentiment) and we recommend using a combination of free text and keywords for the latter (e.g. your specific product).

As for the difference between free text and keywords:

  • Free text uses machine learning models to predict text spans, e.g. if you annotate "product X" in "buy product X" to be a free-text entity "product", it is very likely that when someone says "buy product Y", we give back the string "product Y" as the value for "product" entity.
  • Keywords provide you the ability to add additional data to the recognized free text span, e.g. you can add an alias "foo" to "product X", so when someone says "buy foo", we can also give back "product X" as the value for "product" entity.

Hope this answers your question!

jiayexie avatar Mar 16 '20 23:03 jiayexie

@jiayexie thank you for your response it gives me some path to start with.

I have several tags for the articles with me and i would like to train WIT.ai and got confused should i add those tags to traits so that WIT can detect those from sentences. Any thoughts on the same.

rlakhotiya avatar Mar 17 '20 05:03 rlakhotiya

@rlakhotiya not sure I understand your specific scenario without examples, but if your tags apply to the full body of text instead of some specific words in it, trait is probably your best guess (and in this case, you won't be able to tag free-text/keywords correctly anyways).

jiayexie avatar Mar 17 '20 07:03 jiayexie

@jiayexie thank you for your prompt response. Below is the example of what I am trying to achieve. I am searching for "Risk officer" Sentence 1. Who is risk officer - detects the entity profile_en (trait) Sentence 2. Who is risk officer in your company - detects nothing

Risk officer has been added to expression for the trait and mapped to the respective persons name.

Why does the person name detected in sentence 1 and not in 2 when we add additional "in your company" riskofficer riskofficer1

rlakhotiya avatar Mar 17 '20 07:03 rlakhotiya

As I mentioned earlier, trait is for the feature of the whole sentence, not for a span of text (substring). In this case, the machine learning model thinks the sentence "Who is risk officer in your company" is not very similar to "Who is risk officer".

If you want to detect the phrase "risk officer", or "who is risk officer", you should annotate the phrase as a free-text entity instead of a trait.

jiayexie avatar Mar 17 '20 17:03 jiayexie

@jiayexie thanks for the clarification on the points, I used traits so that it can detect the synonyms automatically like if we added women as expression it can detect for women, girl, ladies. If I use free text can WIT auto detect those kind of synonyms.

rlakhotiya avatar Mar 17 '20 18:03 rlakhotiya

Not sure how the synonyms were handled by traits, but synonyms are actually best handled by keywords, as you can manually define them.

For example, you put in "activity for women", select "women" and create an entity called "group", train and validate the sample. Then you'll be able to click into the "group" entity and manage the keywords there, where you can add synonyms like "ladies" and "girls" to the value "women".

jiayexie avatar Mar 17 '20 18:03 jiayexie

@jiayexie thank you!! Let me try this way will update you if anything required.

rlakhotiya avatar Mar 17 '20 18:03 rlakhotiya

Thanks. Resolving for now.

jiayexie avatar Mar 18 '20 16:03 jiayexie

Thanks. Resolving for now.

Thank you @jiayexie

rlakhotiya avatar Mar 19 '20 15:03 rlakhotiya