ML:有没有python库/示例可用于从纯文本生成问题和答案

2024-06-13 23:26:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用google机器学习api从纯文本生成动态问题和答案。你知道吗

例如,纯文本包含以下信息:

Abraham Lincoln was born on February 12, 1809, in Hardin County, Kentucky, to Thomas and Nancy Lincoln in their one roomlog cabin on their farm known as Sinking Spring (near modern-day Hodgenville, Kentucky). Although Thomas lacked formal education, he was an excellent farmer and carpenter, and often times served as a member of the jury. Lincoln grew up on the western frontier in Kentucky and Indiana. Largely self-educated, he became a lawyer in Illinois, a Whig Party leader, and was elected to the Illinois House of Representatives, in which he served for eight years.

元组格式的预期输出: 问题和答案

("When was Lincoln born?" , "February 12, 1809", "1809", "February 12")
("Where Abraham Lincoln was born?", "Hardin County", "Kentucky", "Hardin County, Kentucky")
("Who is good in farming and carpentering?", "Lincoln", "Abraham Lincoln", "Abraham")
("In which country he grew up?", "western frontier in Kentucky and Indiana")
("How many years he served in Illinois House of Representatives?","eight", "eight years")
("what is IHR?", "Illinois House of Representatives")
("What is full form of IHR?","Illinois House of Representatives")

我试过:

我使用google ML APIs生成了三元组语法列表实体。你知道吗

有人能帮我生成上述输出吗?你知道吗


Tags: andofinonhousehewasborn
1条回答
网友
1楼 · 发布于 2024-06-13 23:26:38

您应该看看Stanford Question Answer数据集。这正是你要找的目的。它也是2017年CS224N的一项任务。您可以找到赋值和起始代码here。这项作业将指导你在TensorFlow中自己编写代码,而且相当彻底。如果您只想提升代码并使用它,您还可以在学生的github上找到这些作业的解决方案。你知道吗

希望这有帮助!你知道吗

相关问题 更多 >