How to recognize names from text using php

I want to extract the name (firstnames and lastnames) from the text using php. Example: From the text below I want to extract the names (in this case, Aline Wright and Jesse Wright)

Aline Wright - cancer survivor, amputee and bride and groom. Wednesday At night, she began to show signs that she had a stroke.

"I began to feel some kind of left arm numbness and facial decline," Alin said.

"I thought I was probably having a stroke."

That when her husband four days, Jesse Wright, put her in a car and dumped her at the Erlanger Medical Center. Wright knows the emergency. He is a nurse mechanic in Erlanger.

+4
source share
3 answers

If you want to make recognized name recognition (NER) using PHP, you need to either call the external NER package or use the online interface to process the natural language .

APIs

Listed below are the three main NLP APIs. The complexity of the Intelligence and Alchemy APIs will probably be moderately easier to use for beginners than OpenCalais.

NER Packages

A few software packages that you can use for NER:

Of these, Stanford CoreNLP is probably a good place to start. Like many NLP APIs, it provides a complete processing pipeline for common tasks such as NER.

+12
source

I would use a name resolver. There are many of them on CPAN , where there is an active community of linguists.

Then in PHP do the following:

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

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

0
source

All Articles