从文本中提取名词和动词 [英] Extracting Nouns and Verbs from Text

查看:165
本文介绍了从文本中提取名词和动词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从文本中提取名词和动词?如果可能,我该如何使用C#?我需要单独提取它们。请帮忙。



谢谢

Is it possible to extract the nouns and verbs from a text? If possible, how can I do it using C#? I need to extract them separately. please help.

thanks

推荐答案

你要找的东西一点都不容易 - 但是,你可以看看这个 [ ^ ] - 它可能会对您有所帮助。
What you are looking for is not at all easy to do - however, you could take a look at this[^] - it could be helpful to you.


严格来说,这是不可能的没有对文本进行详细的句法分析,这与自动翻译具有相同的复杂程度。哦,我甚至在谈论什么?!有些情况下理论上不可能告诉 - 相同的文字可以允许不止一种解释。



在英语中,它尤其如此很容易构建这样的例子。你想用什么语言?



在某些语言中,这样的任务甚至不能制定,因为它们没有名词和动词。



-SA
Strictly speaking it's not possible without detailed syntactic analysis of the text, which has the same level of complexity as automatic translation. Oh, what am I even talking about?! There are cases when it is theoretically impossible to tell — the same text can allow more than one interpretation.

In English, it is especially easy to construct examples like that. What language do you want to use?

In some languages, such task cannot not be even formulated as they don't have nouns and verbs.

—SA


我已经谷歌很多单独提取它们,最后我得到了一个想法。

如果你使用尖锐的NLP比应用pos标记和应用条件来检索名词和动词等特定标签。我只得到NNP标签。

这是一个小小的努力。

Well the i have google alot for extracting them separately and finally i got an idea .
If you are using sharp NLP Than Apply pos tagging and Apply if condition to retrieve specific tags like noun and verbs.And i am getting only NNP tags.
Here is a little effort.
richTextBox1.Show();
            StringBuilder output = new StringBuilder();

            string[] sentences = SplitSentences(rt2.Text);


            foreach (string sentence in sentences)
            {
                string[] tokens = TokenizeSentence(sentence);
                string[] tags = PosTagTokens(tokens);

                for (int currentTag = 0; currentTag < tags.Length; currentTag++)
                {
                  //  output.Append(tokens[currentTag]).Append("/").Append(tags[currentTag]).Append("  ");
                    
                    if (tags[currentTag] == "NNP")
                    {
                        output.Append(tokens[currentTag]).Append("/").Append(tags[currentTag]).Append("  ");
                    }
                }
                
                output.Append("\r\n\r\n");
            }

            richTextBox1.Text = output.ToString();
        }


这篇关于从文本中提取名词和动词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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