I am currently running the Email Management Package from within the studio. It was a great platform to create as many rules as I can in order to get most of the information from the Email. However if there are 3-4 company names were mentioned in the Email. I was only able to extract two companies.
I understood the semantic analysis, Knowledge graph, categorization, extraction clearly.
I also understood what is a scope sentence, ancestor and type of entity while writing the rules.
Sample example of my problem: -
In a sample Email If I type Coles(Which is a supermarket company in Australia) its not detecting this Coles as a company.
But If i type Coles supermarket then it’s extracting this as a company.
Perhaps there is a lack of semantic understanding from my side. I was hoping to get some help from the community on better rules designing/understanding.
Any help from the community is appreciated.
Best answer by lmusetti
You can do that with TAGS. The TAGS syntax in Studio allows for reconditioning the Semantic Analysis. Long story short, you can use rules to patch Semantic Analysis results and change a token’s meaning too. For instance, you could build rules to transform “Coles” into a company name and then leverage this in your rules.
Here’s a sample snippet
@company:104830453 //@SYN: #104830453# [company]
This basically collects all “Coles” mentions and reconditions the Semantic Analysis to make all “Coles” a company name with syn number 104830453. I used KEYWORD to make this simple but you can use other attributes too.
Now, adding a rule like the one below to your extration rules
//Extraction of companies
@Company[TAG(company)]|[TEXT] //@SYN: #104830453# [company]
!ANCESTOR(102424752)+TYPE(NPR) //@SYN: #102424752# [products]
Will collect any of the TAGS you generate as company and extract them along with the other data you’re pulling out of the emails.
You can copy and paste these snippets in your code, they should work well. Just mind that the TAGS configuration (the first part) should go in the config.cr file.
You can find more on TAGS at this link https://docs.expert.ai/studio/latest/languages/tagging/