如何解析地理查询程序的自然语言问题?

How to parse natural language question for geoquery program?

我找到了可以回答一些简单问题的 geoquery 程序,但是我找不到任何关于如何处理问题的演示或说明。

所以我的问题是我怎样才能得到这个:

[what,is,the,shortest,river,?]

进入这个:

answer(A,shortest(A,river(A))).

此外,这个过程是如何完成的?

两个答案:

  1. 这很复杂!
  2. 使用库从问题字符串生成数据结构(我从未尝试过)。

这是我在 SWI Prolog doc site 上发表的评论。可能会有一些帮助。

Start with an overview:

https://plato.stanford.edu/entries/computational-linguistics/

In a recent heavy textbook:

Introduction to Natural Language Processing

by Jacob Eisenstein, 2019

https://mitpress.mit.edu/books/introduction-natural-language-processing

the author goes far beyond "NLP and Parsing" (indeed the part on Formal Language Theory, Context-Free Parsing, Dependency Parsing is only 80 pages of 450) and throws statistics and neural networks at the problem.

Prolog related works by reverse year of publication

An Introduction to Language Processing with Perl and Prolog

by Pierre M. Nugues, 2nd edition, 2014

https://link.springer.com/book/10.1007%2F3-540-34336-9

"An Outline of Theories, Implementation, and Application with Special Consideration of English, French, and German"

Contains an intro to Prolog, specifically SWI-Prolog.

Natural Language Processing Techniques in Prolog

by Patrick Blackburn and Kristina Striegnitz, 2002

http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/index.html

Prolog and Natural-Language Analysis

by Fernando C. N. Pereira and Stuart M. Shieber, (Original 1987, Millenial reissue 2002)

http://www.mtome.com/Publications/PNLA/prolog-digital.pdf

在 SWI-Prolog 中,有一些你应该尝试的东西:

?- pack_install(chat80).
...

?- edit(library(chat80)).

这是CHAT-80系统的复兴版。 在那里您会找到解析器和处理器来回答您的查询。

So my question is how can I get this:

[what,is,the,shortest,river,?]

into this:

answer(A,shortest(A,river(A))).

德克萨斯大学(2005-2009 年)的研究是机器学习:了解 Geobase 程序的作用(1988 年出版)。下载的 Prolog 程序和数据允许您在 Prolog 中查询其内部数据库。缺少将英语查询映射为逻辑查询(可由上述程序执行)的语义解析器。

程序自带2组数据对(250对和880对)的英文查询和逻辑查询。此数据用于机器学习研究。

因此,如果用户输入预解析查询,您可以使用地理查询程序检索逻辑查询,运行逻辑查询并获得结果。

Moreover, how is that process done?

这就是所谓的语义解析。自从 Alain Colmerauer 于 1972 年在天文数据库上开发了一个 QA 应用程序 Orbis、1980 年的 Chat80 系统等

我推荐 Covington 教授(在佐治亚大学任教)的这些书

  • 面向 Prloog 程序员的 NLP (1994)
  • 深入 Prolog 编程(1997)

他的 site 免费提供这些书籍,它们将帮助您在 NLP 领域走得更远。