处理和理解句子

发布于 2024-10-18 03:00:00 字数 99 浏览 8 评论 0原文

我正在尝试编写一个简单的代码来处理句子中的单词以形成含义。很长一段时间以来,我一直在尝试开发一种好的算法,但无论我如何尝试,该算法都非常复杂且冗长。如果您有一些建议,我将不胜感激。谢谢

I am trying to write a simple code that can process words in a sentence to form meaning. I have been trying to develop a good algorithm for a long while now, and however I try to do it the algorithm is scaringly tending to be too complex and long. Please if you have some suggestions, I'd appreciate. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月流歌 2024-10-25 03:00:00

您正在讨论自然语言处理(NLP)领域。这是一个非常复杂的问题,也是一个活跃的研究领域。

可以肯定地说,永远不会有一种简单的方法来解析一般的英语句子,更不用说建立意义了。

苏塞克斯大学信息学院有一套NLP 在线讲座可能会帮助您理解一些使这个问题变得如此困难的问题。

You are discussing the field of Natural Language Processing (NLP). It is a very complex issue, and an area of active research.

It is safe to say there will never be a simple way of parsing a general English sentence, let alone establishing meaning.

The School of Informatics at the Univeristy of Sussex has a set of NLP lectures online that may help you to understand some of the issues which make this such a hard problem.

南笙 2024-10-25 03:00:00

事实证明,算法一定很复杂,而且时间很长,因为大脑实际上是复杂而深刻的。我的代码已经取得了进步,但这并不容易。我的方法是使用一个信息数据库,通过检查每个句子中的每个单词及其含义+关联来进行分析,但无论我多么努力,我发现理解只能是模拟的。例如:

我的口袋里装满了虫子。

将被理解为:

动物虫子在你的口袋里。

含义:

  • 你遇到了麻烦
  • 你是一个错误收集者
  • 你想利用错误来做某事

电子虫在你的口袋里

含义

  • 错误被植入你的口袋
  • 你有一些电子错误

错误的单词数据库(名词)是:

错误(动物)< /em>

  • 定义:昆虫。
  • 性能:宽度:15mm;高度:25mm;颜色:黑色、红色、橙色;
    重要性:相对-生物学;危险:2;期望值:0;
  • 功能:基本

Bug(设备)

  • 定义:电子设备。
  • 性能:宽度:45mm;高度:45毫米;颜色:任意;重要性:相对-安全;危险:2;愿望:1
  • 功能:录音

从上面至少可以推导出两个模拟的含义,算法进行智能猜测,开始一系列问题,以找出确切的含义。

Well, turned out the algorithm has to be complex and long since the brain is actually complex and deep. I have made advances with my code but it's nothing easy. My approach was to use an information database which is analyzed by inspecting every words in each sentence and their meanings + associations but no matter how hard I try, I figured out understanding can only be simulated. For instance:

My pocket is full of bugs.

Will be understood as:

Animal Bugs are in your pocket.

Implications:

  • You are in trouble
  • You are a bug collector
  • You want to use bugs for something

Electronic Bugs are in your pocket

Implications

  • Bugs are planted in your pocket
  • You have some electronic bugs

The word database for bug (NOUN) being:

Bug (Animal)

  • Definition: Insect.
  • Properties: Width: 15mm; Height: 25mm; Color: Black, Red, Orange;
    Importance: Relative - Biology; Danger: 2; Desirability: 0;
  • Function: Base

Bug (Device)

  • Definition: Electronic device.
  • Properties: Width: 45mm; Height: 45mm; Color: Any; Importance: Relative - Security; Danger: 2; Desirability: 1
  • Function: Sound Recording

The two simulated meanings at least can be deduced from the above and the algorithm makes an intelligent guess to begin a series of questions in order to find out exactly what is meant.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文