Solved

Expert.ai Email Management Package rules

  • 17 June 2021
  • 3 replies
  • 50 views

Userlevel 2
Badge

Hi All,

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.

 

Cheers,

Venkat

 

 

icon

Best answer by lmusetti 17 June 2021, 20:04

Hey Venkat!

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

TAGS
{
@company:104830453 //@SYN: #104830453# [company]
}
SCOPE SENTENCE
{
TAGGER(1)
{
@company[KEYWORD("Coles")]
}
}

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

SCOPE SENTENCE
{
 //Extraction of companies
 IDENTIFY(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/

  

View original

3 replies

Badge

Hey Venkat!

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

TAGS
{
@company:104830453 //@SYN: #104830453# [company]
}
SCOPE SENTENCE
{
TAGGER(1)
{
@company[KEYWORD("Coles")]
}
}

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

SCOPE SENTENCE
{
 //Extraction of companies
 IDENTIFY(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/

  

Userlevel 2
Badge

Hi Imusetti,

Thanks for the response. It was very informative. I have seen you talking about Expert.ai on a couple of Panel Discussions. Great fan of your work with Expert.ai.

I will try the code snippets and will let you know if there is any issue.

Cheers,

Venkat.

Badge

Awesome! I’m glad it was helpful and I’m so happy to know you like what we do at expert.ai. There’s more coming :wink: 

Let me know if the snippets worked well!

Reply