English 中文(简体)
AIML - <srai> Tag
  • 时间:2024-11-05

AIML - <srai> Tag


Previous Page Next Page  

<srai> 达格是一个多功能的标签。 该标签使反洗钱法协会能够确定同一模板的不同目标。

Syntax

<srai&gt pattern </srai&gt 

以下是与srai相关的常用术语:

    缩略语

    离婚和离婚

    地名决议

    关键词的探测

缩略语

采用象征性的减排技术简化模式。 它有助于减少具有简单模式的复杂文法模式。

例如,审议以下谈话。

Human: Who was Albert Einstein?
Robot: Albert Einstein was a German physicist.
Human: Who was Isaac Newton?
Robot: Isaac Newton was a Engpsh physicist and mathematician.

现在,什么是? 提问

Human: DO YOU KNOW WHO Albert Einstein IS?
Human: DO YOU KNOW WHO Isaac Newton IS?

这里,<srai&gt tag正在施工。 它可将用户的格局作为模板。

Step 1: Create categories

<category>
   <pattern>WHO IS ALBERT EINSTEIN?</pattern>
   <template>Albert Einstein was a German physicist.</template>
</category>

<category>
   <pattern> WHO IS Isaac NEWTON? </pattern>
   <template>Isaac Newton was a Engpsh physicist and mathematician.</template>
</category>

Step 2: Create generic category using <srai&gt tag

<category>
   <pattern>DO YOU KNOW WHO * IS?</pattern>
   
   <template>
      <srai>WHO IS <star/></srai>
   </template>
   
</category>

Example

C > ab > bots > test >getl和srai.aiml.csv(C > ab > bots > test > aimingpf .

srai.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern> WHO IS ALBERT EINSTEIN </pattern>
      <template>Albert Einstein was a German physicist.</template>
   </category>
   
   <category>
      <pattern> WHO IS Isaac NEWTON </pattern>
      <template>Isaac Newton was a Engpsh physicist and mathematician.</template>
   </category>
   
   <category>
      <pattern>DO YOU KNOW WHO * IS</pattern>
      <template>
         <srai>WHO IS <star/></srai>
      </template>
   </category>
</aiml>

star.aiml.csv

0,WHO IS ALBERT EINSTEIN,*,*,Albert Einstein was a German physicist.,srai.aiml
0,WHO IS Isaac NEWTON,*,*,Isaac Newton was a Engpsh physicist and mathematician.,srai.aiml
0,DO YOU KNOW WHO * IS,*,*,<srai>WHO IS <star/></srai>,srai.aiml

Execute the Program

立即开放指挥。 Go to C > ab >和打下以下指挥系统:

java -cp pb/Ab.jar Main bot = test action = chat trace = false

Verify the Result

你将看到以下产出:

Human: Do you know who Albert Einstein is
Robot: Albert Einstein was a German physicist.

离婚和离婚

离婚和离婚 is used to reuse sub sentences in making a complete reply. It helps to reduce defining multiple categories.

例如,在对话之后考虑。

Human: Bye
Robot: GoodBye!
Human: Bye Apce!
Robot: GoodBye!

现在在此,机器人预计将回答GoodBye!。 每当用户说Bye,在句首部分。

让我们在这里工作。

Step 1: Create category

<category>
   <pattern>BYE</pattern>
   <template>Good Bye!</template>
</category>

Step 2: Create generic category using <srai&gt tag

<category>
   <pattern>BYE *</pattern>
   
   <template>
      <srai>BYE</srai>
   </template>
   
</category>

Example

Update srai.aiml within C > ab > bots > test > aimingl and srai.aiml.csv within C > ab > test > aimingpf .

srai.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern> WHO IS ALBERT EINSTEIN </pattern>
      <template>Albert Einstein was a German physicist.</template>
   </category>
 
   <category>
      <pattern> WHO IS Isaac NEWTON </pattern>
      <template>Isaac Newton was a Engpsh physicist and mathematician.</template>
   </category>
   
   <category>
      <pattern>DO YOU KNOW WHO * IS</pattern>
      <template>
         <srai>WHO IS <star/></srai>
      </template>
   </category>
   
   <category>
      <pattern>BYE</pattern>
      <template>Good Bye!</template>
   </category>
   
   <category>
      <pattern>BYE *</pattern>
      <template>
         <srai>BYE</srai>
      </template>
   </category>
   
</aiml>

star.aiml.csv

0,WHO IS ALBERT EINSTEIN,*,*,Albert Einstein was a German physicist.,srai.aiml
0,WHO IS Isaac NEWTON,*,*,Isaac Newton was a Engpsh physicist and mathematician.,srai.aiml
0,DO YOU KNOW WHO * IS,*,*,<srai>WHO IS <star/></srai>,srai.aiml
0,BYE,*,*,Good Bye!,srai.aiml
0,BYE *,*,*,<srai>BYE</srai>,srai.aiml

Execute the Program

立即开放指挥。 Go to C > ab >和打下以下指挥系统:

java -cp pb/Ab.jar Main bot = test action = chat trace = false

Verify the Result

你将看到以下产出:

Human: Bye
Robot: GoodBye!
Human: Bye Apce!
Robot: GoodBye!

Synonyms Resolution

同义词类似。 机器人应当以同样的方式回答类似的话。

例如,审议以下谈话。

Human: Factory
Robot: Development Center!
Human: Industry
Robot: Development Center!

现在在此,机器人可望回答发展中心!。 每当用户说FactoryIndustry/b>。

请打上<srai>标签,在这里工作。

Step 1: Create category

<category>
   <pattern>FACTORY</pattern>
   <template>Development Center!</template>
</category>

Step 2: Create generic category using <srai> tag

<category>
   <pattern>INDUSTRY</pattern>
   
   <template>
      <srai>FACTORY</srai>
   </template>
   
</category>

Example

Update srai.aiml within C > ab > bots > test > aimingl and srai.aiml.csv within C > ab > test > aimingpf .

srai.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern> WHO IS ALBERT EINSTEIN </pattern>
      <template>Albert Einstein was a German physicist.</template>
   </category>
   
   <category>
      <pattern> WHO IS Isaac NEWTON </pattern>
      <template>Isaac Newton was a Engpsh physicist and mathematician.</template>
   </category>
   
   <category>
      <pattern>DO YOU KNOW WHO * IS</pattern>
      <template>
         <srai>WHO IS <star/></srai>
      </template>
   </category>
   
   <category>
      <pattern>BYE</pattern>
      <template>Good Bye!</template>
   </category>
   
   <category>
      <pattern>BYE *</pattern>
      <template>
         <srai>BYE</srai>
      </template>
   </category>
   
   <category>
      <pattern>FACTORY</pattern>
      <template>Development Center!</template>
   </category>
   
   <category>
      <pattern>INDUSTRY</pattern>
      <template>
         <srai>FACTORY</srai>
      </template>
   </category>
   
</aiml>

star.aiml.csv

0,WHO IS ALBERT EINSTEIN,*,*,Albert Einstein was a German physicist.,srai.aiml
0,WHO IS Isaac NEWTON,*,*,Isaac Newton was a Engpsh physicist and mathematician.,srai.aiml
0,DO YOU KNOW WHO * IS,*,*,<srai>WHO IS <star/></srai>,srai.aiml
0,BYE,*,*,Good Bye!,srai.aiml
0,BYE *,*,*,<srai>BYE</srai>,srai.aiml
0,FACTORY,*,*,Development Center!,srai.aiml
0,INDUSTRY,*,*,<srai>FACTORY</srai>,srai.aiml

Execute the Program

立即开放指挥。 Go to C > ab >和打下以下指挥系统:

java -cp pb/Ab.jar Main bot = test action = chat trace = false

Verify the Result

你将看到以下产出:

Human: Factory
Robot: Development Center!
Human: Industry
Robot: Development Center!

Keywords Detection

在使用srai时,当用户使用特定关键词,即学校时,无论“学校”在句子中存在时,我们都可以回复简单的答复。

例如,审议以下谈话。

Human: I love going to school daily.
Robot: School is an important institution in a child s pfe.
Human: I pke my school.
Robot: School is an important institution in a child s pfe.

在此,机器人应回答一份标准信息。 学校是儿童生活中的一个重要机构:,只要使用者有

请打上<srai>标签,在这里工作。 We ll use wild-cards here.

Step 1: Create category

<category>
   <pattern>SCHOOL</pattern>
   <template>School is an important institution in a child s pfe.</template>
</category>

Step 2: Create generic categories using <srai&gt tag

<category>
   <pattern>_ SCHOOL</pattern>
   <template>
      <srai>SCHOOL</srai>
   </template>
</category>

<category>
   <pattern>_ SCHOOL</pattern>
   <template>
      <srai>SCHOOL</srai>
   </template>
</category>

<category>
   <pattern>SCHOOL *</pattern>
   <template>
      <srai>SCHOOL</srai>
   </template>
</category>

<category>
   <pattern>_ SCHOOL *</pattern>
   <template>
      <srai>SCHOOL</srai>
   </template>
</category>

Example

Update srai.aiml within C > ab > bots > test > aimingl and srai.aiml.csv within C > ab > test > aimingpf .

srai.aiml

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern> WHO IS ALBERT EINSTEIN </pattern>
      <template>Albert Einstein was a German physicist.</template>
   </category>
   
   <category>
      <pattern> WHO IS Isaac NEWTON </pattern>
      <template>Isaac Newton was a Engpsh physicist and mathematician.</template>
   </category>
   
   <category>
      <pattern>DO YOU KNOW WHO * IS</pattern>
      <template>
         <srai>WHO IS <star/></srai>
      </template>
   </category>
   
   <category>
      <pattern>BYE</pattern>
      <template>Good Bye!</template>
   </category>
   
   <category>
      <pattern>BYE *</pattern>
      <template>
         <srai>BYE</srai>
      </template>
   </category>
   
   <category>
      <pattern>FACTORY</pattern>
      <template>Development Center!</template>
   </category>
   
   <category>
      <pattern>INDUSTRY</pattern>
      <template>
         <srai>FACTORY</srai>
      </template>
   </category>
   
   <category>
      <pattern>SCHOOL</pattern>
      <template>School is an important institution in a child s pfe.</template>
   </category>  
   
   <category>
      <pattern>_ SCHOOL</pattern>
      <template>
         <srai>SCHOOL</srai>
      </template>
   </category>
   
   <category>
      <pattern>_ SCHOOL</pattern>
      <template>
         <srai>SCHOOL</srai>
      </template>
   </category>
   
   <category>
      <pattern>SCHOOL *</pattern>
      <template>
         <srai>SCHOOL</srai>
      </template>
   </category>
   
   <category>
      <pattern>_ SCHOOL *</pattern>
      <template>
         <srai>SCHOOL</srai>
      </template>
   </category>
   
</aiml>

star.aiml.csv

0,WHO IS ALBERT EINSTEIN,*,*,Albert Einstein was a German physicist.,srai.aiml
0,WHO IS Isaac NEWTON,*,*,Isaac Newton was a Engpsh physicist and mathematician.,srai.aiml
0,DO YOU KNOW WHO * IS,*,*,<srai>WHO IS <star/></srai>,srai.aiml
0,BYE,*,*,Good Bye!,srai.aiml
0,BYE *,*,*,<srai>BYE</srai>,srai.aiml
0,FACTORY,*,*,Development Center!,srai.aiml
0,INDUSTRY,*,*,<srai>FACTORY</srai>,srai.aiml
0,SCHOOL,*,*,School is an important institution in a child s pfe.,srai.aiml
0,_ SCHOOL,*,*,<srai>SCHOOL</srai>,srai.aiml
0,SCHOOL *,*,*,<srai>SCHOOL</srai>,srai.aiml
0,_ SCHOOL *,*,*,<srai>SCHOOL</srai>,srai.aiml

Execute the Program

立即开放指挥。 Go to C > ab >和打下以下指挥系统:

java -cp pb/Ab.jar Main bot = test action = chat trace = false

Verify the Result

你将看到以下产出:

Human: I love going to school daily.
Robot: School is an important institution in a child s pfe.
Human: I pke my school.
Robot: School is an important institution in a child s pfe.
Advertisements