如何使用 php 识别文本中的姓名

发布于 2024-10-05 04:26:08 字数 358 浏览 0 评论 0原文

我想使用 php 从文本中提取姓名(名字和姓氏)。 例子: 我想从下面的文本中提取姓名(在本例中为 Aline Wright 和 Jesse Wright)

艾琳·赖特 (Aline 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."

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

司马昭之心 2024-10-12 04:26:08

如果您想使用 PHP 进行命名实体识别 (NER) ,您需要调用外部 NER 包或使用在线自然语言处理 API

API

下面列出了 NLP API。对于初学者来说,Complexity Intelligence 和 Alchemy API 可能比 OpenCalais 更容易使用。

NER 软件包

您可以用于 NER 的一些软件包是:

其中,Stanford CoreNLP 可能是一个好地方开始。与许多 NLP API 类似,它为 NER 等常见任务提供完整的处理管道。

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.

APIs

NLP API are listed below. Complexity Intelligence and Alchemy API will probably be moderately easier to use for beginners than OpenCalais.

NER Packages

A few software packages you can use for NER are:

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.

烈酒灼喉 2024-10-12 04:26:08

我会使用命名实体识别器。 CPAN 上有很多这样的内容,那里有一个活跃的语言学社区。

然后,在 PHP 中,执行以下操作:

$result = \`perl named_entity_recogniser.pl "myText"\`;

I'd use a named entity recognizer. There are many of these up on CPAN where there is an active linguistics community.

Then, in PHP, do something like:

$result = \`perl named_entity_recogniser.pl "myText"\`;
殊姿 2024-10-12 04:26:08

我编写了这个 PHP 扩展,但准备从源代码进行编译。
https://github.com/rjjakes/MITIE-PHP

I wrote this PHP extension but be prepared to compile from source.
https://github.com/rjjakes/MITIE-PHP

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文