搜索图书馆以了解问题及其对“谁?”、“什么?”、“为什么?”等问题的回答 上下文无关语法

问题描述

我想编写一个代码,它获取文本并从中提取信息以了解例如一个“农民”是。它应该记住例如有以下问题/答案的“农民”:

谁?答案:一个

什么?答案:植物蔬菜

为什么?答:因为他想赚钱

是否有现有的图书馆,实施了这样的问答系统?最好在 C++ 中?唯一与此类似的描述如下(但它忽略了“谁?”、“什么?”、“为什么?”问题的方案。

# This grammar is from Allison Parrish
# https://github.com/aparrish/rwet-examples

# clauses
S -> NP VP
S -> Interj NP VP
NP -> Det N
NP -> Det N that VP
NP -> Det Adj N
VP -> Vtrans NP   # transitive verbs have direct objects
VP -> Vintr       # intransitive verbs have no direct object

# terminals
Interj -> oh,| my,| wow,| damn,Det -> this | that | the
N -> amoeba | dichotomy | seagull | trombone | corsage | restaurant | suburb
Adj -> bald | smug | important | tame | overstaffed | luxurIoUs | blue
Vtrans -> computes | examines | foregrounds | prefers | interprets | spins
Vintr -> coughs | daydreams | whines | slobbers | vocalizes | sneezes ```

from: https://github.com/shiffman/A2Z-F16/blob/gh-pages/week8-cfg/02_cfg_reader/test.grammar

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...