如何确定一个句子是否在谈论某个特定主题? [英] How to determine if a sentence is talking about a specific subject?
问题描述
我有预定义的单词,想知道句子的主要主题是否与预定义的单词有关.
I have predefined words and would like to know if the sentence primary subject is about the predefined words.
示例:
预定义词: iPhone,Nexus,HTC
Predefined words: iPhone, Nexus, HTC
句子:
我喜欢iPhone的新设计-主要主题是iPhone
I like the new design of iPhone - primary subject is iPhone
我正在Nexus上向Nirvana列表. -主要主题不是预定义的单词
I am listing to Nirvana on my Nexus. - primary subject is not in predefined words
HTC手机比iPhone更好-主要主题是HTC
The HTC phone is better than iPhone - primary subject is HTC
想用PHP或具有PHP接口的我做这件事.
Would like to do this in PHP or something I that can have PHP interface.
推荐答案
Alias-i具有 PHP的自然语言解析器.
Alias-i has a natural language parser for PHP.
此页面表示Alias-i的解析器是用以下语言编写的PHP,但是Alias-i的网站说它是用Java编写的.
this page says Alias-i's parser is written in PHP, but Alias-i's website says it is written in Java.
这篇关于如何确定一个句子是否在谈论某个特定主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!