聊天机器人对话对象,你的方法是什么?

发布于 2024-11-19 03:35:05 字数 1556 浏览 4 评论 0原文

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

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

发布评论

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

评论(1

一紙繁鸢 2024-11-26 03:35:05

在编程中,即使在决定什么对象以及如何对象之前,拥有明确的目标也很重要。不幸的是,从我上面读到的内容来看,这并不是很清楚。

所以首先忘记程序的如何。忘记对象、代码以及它们的作用。

现在想象一下其他人将为您编写该程序。一个如此优秀的程序员,他们不需要你告诉他们如何编码。以下是他们可能会问您的一些问题。

  1. 用一句话概括你的程序的目的是什么?
  2. 尽可能简单地向我解释主要术语,IRC,对话。
  3. 它必须能够做什么?简短的要点。
  4. 按步骤解释您将如何使用该程序,例如:
    • 我输入
    • 然后它说
    • 根据天气...它给了我一个列表...

完成此操作后,忘记你的 convo 对象或其他什么,并根据 1、2 和 4 进行思考。在笔上并思考你的问题的主要元素,即对话。不要只是创建对象......你会找到它们。

现在考虑这些元素之间的相互作用。即

“机器人将消息添加到主题,用户将消息添加到主题,来自主题的消息被发送到日志。”

这将帮助您找到对象是什么、它们必须做什么以及它们需要存储什么信息。

话虽如此,我想说你最大的问题是你承担的事情超出了你的承受范围。首先,计算机识别单词并将其放入主题中是相当复杂的,并且涉及语言学和/或统计学。作为一名新程序员,我倾向于避开这些领域,因为它们只会让你失望,并在此过程中扼杀你的动力。从小事做起...然后做大事。尝试搞乱 GUI 编程,然后制作一个简单的计算器之类的东西......

having clear goals is important in programming even before you set out deciding what objects and how. Unfortunately from what I've read above this isn't really clear.

So first forget the how of the program. forget about the objects, the code and what they do.

Now Imagine someone else was going to write for you the program. someone who is such a good programmer, they don't need you do tell them how to code. here are some questions they might ask you.

  1. What is the purpose of your program in one sentence?
  2. explain to me as simply as possible the main terms, IRC, Conversation.
  3. what must it be able do? short bullet points.
  4. explain in steps how you would use the program eg:
    • i type in
    • it then says
    • depending on weather... it gives me a list of this...

Having done this then forget about your convo object or whatever and think in terms of 1, 2 and 4. On Pen and paper think about the main elements of your problems i,e Conversations.Don't Just create Objects... you'll find them.

Now think about the relationships of those elements in terms of how they interact. i.e.

"Bot adds message to Topic, User adds message to Topic, messages from Topic are sent to Log."

this will help you find what the objects are, what they must do and what information they'll need to store.

Having said all that, I would say your biggest problem is your taking on more than you can chew. To begin with, for a computer to recognise words and put them into topics is quite complicated and involves linguistics and/or statistics. As a new programmer I'd tend to avoid these areas because they will simply let you down and in the process kill your motivation. start small... then go BIG. try messing with GUI programming, then make a simple calculator and stuff...

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