Python NLTK找出时态 [英] Python NLTK figure out tense

查看:331
本文介绍了Python NLTK找出时态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将句子翻译成英语的Web应用程序;用户从基本上提供上下文的下拉菜单中选择选项.现在,我想将单词和上下文转换成英语句子.

I have a web application that translates sentences into English; the user chooses options from drop downs that basically provide the context. Now I want to turn the word and the context into an English sentence.

一种情况是用户选择谁"和何时",谁"可以是:我,你们,你们两个,他,她,我们,他们. 何时"可能是:做了",会做",可能会做",会做",会做!".因此,最后我将得到用户输入的字词,以及输入的时间和地点.前任. 'sing','you','did it'会得到英语句子"You sang".

One case is that the user chooses 'who' and 'when', 'who' could be: I, you, you two, he, she, we, they. 'When' could be: 'did it', 'will do it', 'might do it', 'does it', 'do it!'. So in the end I would have the word that the user put in, as well as who and when. ex. 'sing', 'you', 'did it' would get the English sentence "You sang".

另一种情况是带有"chase"的及物动词,仍然有"who"和"when",还有"done to"的另一个选项,基本上是另一个"who"菜单.前任. 追逐",我",会做",他们"会得到英语句子我要追逐他们".

Another case is with transitive verbs like "chase", there would still be 'who' and 'when' but also another option of 'done to' which is basically another 'who' menu. ex. 'chase', 'I', 'will do it', 'they' would get the English sentence "I am going to chase them".

我是NLTK的新手,所以我真的不知道从哪里开始这个问题.谁能指出我从何处着手的大致方向?

I'm new to the NLTK so I don't really know where to start with this problem. Can anyone point me in the general direction of where to start with this?

推荐答案

NLTK是一个相当大的项目,其中包含许多有用的工具.我建议您先阅读 NLTK书,这做得很好.您可能可以浏览前几章.

NLTK is a fairly large project containing a lot of useful tools. I'd suggest starting out by reading the NLTK Book, which is very well done. You can probably skim the first few chapters.

您要查找的内容在第7章及以后的章节中.

The stuff you're looking for is in chapters 7 and beyond.

这篇关于Python NLTK找出时态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆