查询分析使用自然语言处理确定单词之间的关系(Query Analysis to determine the relationship between words using natural langu

编程入门 行业动态 更新时间:2024-10-28 06:26:30
查询分析使用自然语言处理确定单词之间的关系(Query Analysis to determine the relationship between words using natural language processing)

样本句子

a)谁是IBM的首席执行官?

b)IBM办公室在哪里?

该系列操作应用于上述句子,使用标记化,pos标记和分块来提取关系。

IBM首席执行官 - (Extracted Tuple) - > [Who,Ceo of IBM]

IBM办公室位于 何处 - (Extracted Tuple) - > [Where,IBM Office Location]

从提取的依赖项中,我如何确定问题的内容? 句子中的WPWHP单词如何表明从基于知识的数据集中提取数据需要进行何种查询。

比如a) 指向名称,地点或任何其他命名实体。

在b)指向名称,地点或任何其他命名实体的地方。

任何使用自然语言处理技术或文本挖掘的建议都受到高度赞赏。

Sample Sentence

a) Who is the Ceo of IBM?

b) Where is IBM office located?

The series of operation is applied to above sentence using tokenization, pos-tagging and chunking to extract relationship.

Who is the Ceo of IBM -- (Extracted Tuple) --> [Who, Ceo of IBM]

Where is IBM office located -- (Extracted Tuple) --> [Where, IBM Office Located]

From Extracted dependencies how will I determine that what the Question is about? How the WP and WHP words in the sentence indicate that what kind of query to be made to extract data from the knowledge-based data set.

like in a) Who is pointing toward name, place or any another named entity.

and in b) Where is pointing toward name, place or any another named entity.

Any advice using natural language processing techniques or text mining is highly appreciated.

最满意答案

这取决于您期望的输入句子的可变性。 对于您提供的示例,您可以使用非常简单的模式匹配。 只需设置一些模式,如

WHO IS ...? -> [who, ...] WHERE IS ...? -> [where, ...] WHERE CAN I FIND ...? -> [where, ...]

然后使用字符串匹配在输入数据中定位这些模式。 如有必要,您甚至可以使用正则表达式:

s/who is \(.*\)/[who, \1]/

(使用sed风格搜索并在此处替换)

这当然只与那些特定的例子相匹配,但是如果你的大多数数据都是这样,你可能不需要一个完整的NLP方法。 您可以随时添加更多这样的模式,但在某些时候它可能会变得难以管理。 但是,这可能会让您在特定问题上走得更远。

你当然可以做一个完整的句法分析,但它可能有点过分和过于脆弱。 正确的方法完全取决于您的用例。

It depends on the variability of input sentences you are expecting. For the examples you give, you could use very simple pattern matching. Just set up a few patterns such as

WHO IS ...? -> [who, ...] WHERE IS ...? -> [where, ...] WHERE CAN I FIND ...? -> [where, ...]

And then use string matching to locate those patterns in your input data. You could even use regular expressions if necessary:

s/who is \(.*\)/[who, \1]/

(using sed-style search and replace here)

This will of course only match those particular examples, but if most of your data looks like it, you might not need a full-blown NLP approach. You can always add more patterns like that, though at some point it might become unmanageable. However, this could get you quite far for your particular problem.

You can of course do a full syntactic analysis, but it might be overkill & too brittle. The right approach depends fully on your use case.

更多推荐

本文发布于:2023-07-26 08:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1272882.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自然语言   单词   关系   Analysis   Query

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!