Frage

My aim is detecting simple elements in any sentence such as verb, noun or adjective. Is there any gem in Ruby for achieving that? For example:

They elected him president yesterday.

Output:

["subject","verb", "object", "predicative", adverbial"]
War es hilfreich?

Lösung

These are the only natural language processing options for Ruby that I know of.

Interestingly, they are all by the same person.

EDIT Here is one more option that I found. It's a tutorial on n-gram analysis.

Natural Language Processing with Ruby: n-grams

Andere Tipps

I've used engtagger with good success in the past. It's ported from a Perl program called Lingua::EN::Tagger. It takes a bit of work to get it to do what you want, but I think it's the best tool available for this application (at least at the moment).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top