Apache Open NLP中的自定义模型 [英] Custom model in Apache Open NLP

查看:102
本文介绍了Apache Open NLP中的自定义模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用自定义模型,正在针对自己的用例进行培训.我的用例是根据是否是地址更改请求对电子邮件进行分类.如果可以从一个句子中了解地址更改请求,则说明该请求运行正常,没有任何问题.但是,如果需要从多个句子中了解地址更改请求,则该请求不起作用. 下面举几个例子: 示例1:-这很奏效 1. a)培训文件:-

I am working currently with custom models which I am training for my own use case. My use case is to classify emails based on whether it is an address change request. If the address change request could be understood from a single sentence, it is working fine without issues. But if the address change request needs to be understood from multiple sentences, it is not working. Giving few examples below :- Example 1 :- THIS IS WORKING 1. a)training file :-

Guys I wish to <START:contactupdate> change my address <END> .

我的新地址是CV1 4ED,西米德兰兹郡,考文垂,多塞特路68号. 完成后请确认. 谢谢.

My new address is 68 Dorset Road, Coventry, West Midlands, CV1 4ED. Please confirm once you are done. Thanks.

b)带有以下句子的测试模型:- 字符串输入=伙计们,我想更改我的地址.我的新地址是CV1 4ED,西米德兰兹郡考文垂多塞特路68号.完成后请确认.谢谢."//工作

b)Testing model with the below sentence :- String input = "Guys I wish to change my address.My new address is 68 Dorset Road, Coventry, West Midlands, CV1 4ED.Please confirm once you are done. Thanks."; //Working

  1. 示例2:-这不起作用. 可以说,只能从多行中推断出地址更改请求.

  1. EXAMPLE 2 :- This is not working. Lets say the address change request can only be deduced from multiple lines.

我的旧地址不再有效.需要更新."

"My old address is no longer valid. Need to update it."

在这种情况下如何训练我的模型?如何在上面指定自定义标签?

How do I train my model in this scenario?How do I specify the custom tags for above?

请您帮忙.我被困住了. 非常感谢

Can you please help. I am stuck. Many Thanks

推荐答案

如果我正确理解了您的问题,我认为您正在尝试对电子邮件进行分类,以查找其地址是否更改.但是模型示例看起来像是命名实体.我认为,最好使用Apache OpenNLP的文档分类程序"功能.

If I understand your question correctly, I think you are trying to categorize emails to find out if its for address change. But the model example looks like for named entity. In my opinion, it might be better to use "Document Categorizer" feature of Apache OpenNLP.

您可以为可能的句子提供不同的样本,这些样本可以归类为地址更改. 地址更改",一般查询"等可以是一个类别.这样,您可以根据需要添加任意数量的不同样本,以及多种句子变体.这是简单&文档分类培训的基本教程用法.

You can provide different samples for possible sentences which can be categorized as address change. "Address_change", "general_inquiry" etc. can be a categories. This way you can add as many different sampels as you want with many variations of sentences. Here is easy & basic tutorial for document categorization training & usage.

这篇关于Apache Open NLP中的自定义模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆