我想使用 php 从文本中提取姓名(名字和姓氏).例子:从下面的文本中,我想提取姓名(在本例中为 Aline Wright 和 Jesse Wright)
I want to extract name(firstnames and lastnames) from a text using php. Example: From text below I want to extract names(in this case Aline Wright and Jesse Wright)
艾琳·赖特是一名癌症幸存者,截肢者和新婚夫妇.周三晚上她开始表现出她是中风了.
Aline Wright is a cancer survivor, amputee and a newlywed. Wednesday night she began to show signs she was having a stroke.
我开始感觉到一些左臂麻木和面部下垂,"说艾琳.
"I started feeling some left arm numbness and a facial droop," said Aline.
在我看来,我可能是中风了."
"It appeared to me that I was probably having a stroke."
那是她结婚四天的丈夫,杰西·赖特,把她放在车里将她送往厄兰格医疗中心中心.赖特知道紧急情况.他是 Erlanger 的一名护士技师.
That's when her husband of four days, Jesse Wright, put her in the car and rushed her to the Erlanger Medical Center. Wright knows an emergency. He is a nurse technician at Erlanger.
如果你想做 命名实体识别 (NER) 使用 PHP,您需要调用外部 NER 包 或使用在线自然语言处理API.
If you want to do named entity recognition (NER) using PHP, you'll need to either call out to an external NER package or make use of an online natural language processing API.
API
下面列出了 NLP API.对于初学者来说,Complexity Intelligence 和 Alchemy API 可能比 OpenCalais 更容易使用.
NLP API are listed below. Complexity Intelligence and Alchemy API will probably be moderately easier to use for beginners than OpenCalais.
NER 包
您可以用于 NER 的一些软件包是:
A few software packages you can use for NER are:
其中,Stanford CoreNLP 可能是一个不错的起点.与许多 NLP API 类似,它为 NER 等常见任务提供了完整的处理管道.
Of these, Stanford CoreNLP is probably a good place to start. Similar to many NLP APIs, it provides a complete processing pipeline for common tasks such as NER.
这篇关于如何使用php识别文本中的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!