想要更深入玩转聊天机器人开发? 推荐本文档 + 课程《DeepSeek 聊天机器人项目》一起学习,效果翻倍! 边学边练,轻松打造智能对话系统~ (๑•̀ㅂ•́)و✧ 快上车,AI 之旅发车啦!

一、为 DeepSeek Chatbot 准备零件

项目演示

输入提示词:

  1. Who are you?
  2. How to develop a chatbot?

环境准备

前端语言使用 HTML CSS JS

后端语言使用 Python https://www.python.org/

编辑器使用 VS Code https://code.visualstudio.com/

项目搭建

安装 Flask 库 pip install Flask

deepseek-chatbot/app.py

from flask import Flask, render_template

# 创建一个 Flask 应用实例
app = Flask(__name__) # 定义一个路由和视图函数
@app.route('/')
def home():
return render_template("index.html") # 运行应用
if __name__ == '__main__':
app.run(debug=True)

deepseek-chatbot/templates/index.html

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chatbot</title>
<link rel="stylesheet" href="/static/index.css">
</head> <body>
<h1></h1>
<script src="/static/index.js"></script>
</body> </html>

deepseek-chatbot/static/index.css

h1 {
text-align: center;
}

deepseek-chatbot/static/index.js

console.log(123);

二、给 DeepSeek Chatbot 美化界面

deepseek-chatbot/templates/index.html

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chatbot</title>
<link rel="stylesheet" href="/static/index.css">
</head> <body>
<h1></h1> <div class="chat">
<div class="chat-content">
<!-- <div class="user-message">introduce yourself</div>
<pre
class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
<div class="user-message">introduce yourself</div>
<pre
class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
<div class="user-message">introduce yourself</div>
<pre
class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
<div class="user-message">introduce yourself</div>
<pre
class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre> --> </div>
<div class="chat-form">
<input type="text" id="user-message-ipt">
<button id="send-btn">Send</button>
</div>
</div> <script src="/static/index.js"></script>
</body> </html>

deepseek-chatbot/static/index.css

h1 {
text-align: center;
} .chat {
max-width: 600px;
margin: 0 auto;
border: 1px solid #ccc;
background-color: #f9f9f9;
} .chat-content {
padding: 20px;
height: 400px;
overflow-y: scroll;
} .chat-content .user-message {
text-align: right;
} .chat-content .robot-message {
white-space: pre-wrap;
} .chat-form {
padding: 10px;
display: flex;
} .chat-form input {
flex-grow: 1;
padding: 5px;
border: 1px solid #ccc;
margin-right: 10px;
} .chat-form button {
flex-grow: 0;
padding: 5px 10px;
border: 1px solid #ccc;
cursor: pointer;
}

deepseek-chatbot/static/index.js

console.log(123);

window.onload = () => {
const chatContent = document.querySelector('.chat-content')
const userMessageIpt = document.querySelector('#user-message-ipt')
const sendBtn = document.querySelector('#send-btn') sendBtn.onclick = () => {
const userMessage = userMessageIpt.value
// <div class="user-message">introduce yourself</div>
const userMessageDiv = document.createElement('div')
userMessageDiv.className = 'user-message'
userMessageDiv.textContent = userMessage
chatContent.append(userMessageDiv)
// <pre class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
const robotMessagePre = document.createElement('pre')
robotMessagePre.className = 'robot-message'
robotMessagePre.textContent = "I'm a robot!"
chatContent.append(robotMessagePre)
}
}

三、教 DeepSeek Chatbot 会话补全

会话补全接口

https://api-docs.deepseek.com/zh-cn/api/create-chat-completion

错误码

https://api-docs.deepseek.com/zh-cn/quick_start/error_codes

模型 & 价格

https://api-docs.deepseek.com/zh-cn/quick_start/pricing

deepseek-chatbot/static/index.js

console.log(123);

window.onload = () => {
const chatContent = document.querySelector('.chat-content')
const userMessageIpt = document.querySelector('#user-message-ipt')
const sendBtn = document.querySelector('#send-btn') sendBtn.onclick = () => {
const userMessage = userMessageIpt.value
// <div class="user-message">introduce yourself</div>
const userMessageDiv = document.createElement('div')
userMessageDiv.className = 'user-message'
userMessageDiv.textContent = userMessage
chatContent.append(userMessageDiv)
// <pre class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
// const robotMessagePre = document.createElement('pre')
// robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = "I'm a robot!"
// chatContent.append(robotMessagePre) // 服务端接口:http://127.0.0.1/api/chat
// 请求方法:POST
// 请求体:{"user_message": "Hi"}
// 响应体:{"robot_message": "Hello"} fetch('/api/chat', {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ "user_message": userMessage })
})
.then(response => response.json())
.then(data => {
const robotMessagePre = document.createElement('pre')
robotMessagePre.className = 'robot-message'
robotMessagePre.textContent = data['robot_message']
chatContent.append(robotMessagePre)
})
}
}

deepseek-chatbot/app.py

from flask import Flask, render_template, request
import requests
import json app = Flask(__name__) @app.route('/')
def home():
return render_template("index.html") @app.route('/api/chat', methods=['POST'])
def api_chat():
user_message = request.json.get('user_message') url = "https://api.deepseek.com/chat/completions"
payload = json.dumps({
"messages": [
{
"content": user_message,
"role": "user"
}
],
"model": "deepseek-chat",
"n": 1
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-ca3371d655c3431397022c8cee313788'
}
response = requests.request("POST", url, headers=headers, data=payload)
robot_message = response.json()['choices'][0]['message']['content']
return {"robot_message": robot_message} if __name__ == '__main__':
app.run(debug=True, port=80)

deepseek-chatbot/test.py

安装 requests 库 pip install requests

import requests
import json url = "https://api.deepseek.com/chat/completions" payload = json.dumps({
"messages": [
{
"content": "Hi",
"role": "user"
}
],
"model": "deepseek-chat",
"n": 1
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-ca3371d655c3431397022c8cee313788'
} response = requests.request("POST", url, headers=headers, data=payload)
print(response.status_code)
print(response.text)
robot_message = response.json()['choices'][0]['message']['content']
print(robot_message)

四、学 DeepSeek 流式 API

Server-sent events 服务器发送事件

https://developer.mozilla.org/zh-CN/docs/Web/API/Server-sent_events/Using_server-sent_events

deepseek-chatbot/app.py

from flask import Flask, render_template, request, Response
import requests
import json app = Flask(__name__) @app.route('/')
def home():
return render_template("index.html") @app.route('/api/chat', methods=['POST'])
def api_chat():
user_message = request.json.get('user_message') url = "https://api.deepseek.com/chat/completions" payload = json.dumps({
"messages": [
# {
# "content": "You are a software developer",
# "role": "system"
# },
{
"content": user_message, # Hello! How can I assist you today?
"role": "user" # 你好!很高兴见到你。你今天想学些什么中文呢?
} # Hello! How can I assist you today? Are you working on a coding project, or do you have a question about software development? Let me know!
],
"model": "deepseek-chat",
"n": 1
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-492ec2acc35c4d20b6ab2c9490fcef0d'
} response = requests.request("POST", url, headers=headers, data=payload) robot_message = response.json()['choices'][0]['message']['content']
return {"robot_message": robot_message} @app.route('/api/v2/chat')
def api_v2_chat():
import time
def robot_message():
for chunk in ["I'm ", "a ", "robot"]:
# yield chunk
# yield "data: " + chunk + "\n\n"
yield "data: " + json.dumps({'chunk': chunk}) + "\n\n"
time.sleep(1)
yield "data: [DONE]\n\n" return Response(robot_message(), content_type="text/event-stream") if __name__ == '__main__':
app.run(debug=True, port=80)

deepseek-chatbot/static/index.js

console.log(123);

window.onload = () => {
const chatContent = document.querySelector('.chat-content')
const userMessageIpt = document.querySelector('#user-message-ipt')
const sendBtn = document.querySelector('#send-btn') sendBtn.onclick = () => {
const userMessage = userMessageIpt.value userMessageIpt.value = ''
sendBtn.disabled = true // <div class="user-message">introduce yourself</div>
const userMessageDiv = document.createElement('div')
userMessageDiv.className = 'user-message'
userMessageDiv.textContent = userMessage
chatContent.append(userMessageDiv)
// <pre class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
// const robotMessagePre = document.createElement('pre')
// robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = "I'm a robot!"
// chatContent.append(robotMessagePre) // 服务端接口:http://127.0.0.1/api/chat
// 请求方法:POST
// 请求体:{"user_message": "Hi"}
// 响应体:{"robot_message": "Hello"} // fetch('/api/chat', {
// method: "POST",
// headers: { "Content-Type": "application/json" },
// body: JSON.stringify({ "user_message": userMessage })
// })
// .then(response => response.json())
// .then(data => {
// const robotMessagePre = document.createElement('pre')
// robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = data['robot_message']
// chatContent.append(robotMessagePre)
// }) const robotMessagePre = document.createElement('pre')
robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = "I'm a robot!"
chatContent.append(robotMessagePre)
const eventSource = new EventSource('/api/v2/chat')
eventSource.onmessage = (event) => {
console.log(event.data);
if (event.data == '[DONE]') {
eventSource.close()
sendBtn.disabled = false
} else {
robotMessagePre.textContent += JSON.parse(event.data)['chunk']
}
}
}
}

五、让 DeepSeek Chatbot 像流水般说话

对话补全接口

https://api-docs.deepseek.com/zh-cn/api/create-chat-completion

deepseek-chatbot/static/index.js

console.log(123);

window.onload = () => {
const chatContent = document.querySelector('.chat-content')
const userMessageIpt = document.querySelector('#user-message-ipt')
const sendBtn = document.querySelector('#send-btn') sendBtn.onclick = () => {
const userMessage = userMessageIpt.value userMessageIpt.value = ''
sendBtn.disabled = true // <div class="user-message">introduce yourself</div>
const userMessageDiv = document.createElement('div')
userMessageDiv.className = 'user-message'
userMessageDiv.textContent = userMessage
chatContent.append(userMessageDiv)
// <pre class="robot-message">Hello! I’m an AI language model created to assist with answering questions, providing information, brainstorming ideas, and helping with various tasks. I don’t have personal experiences or emotions, but I’m here to help you with whatever you need. Feel free to ask me anything—whether it’s about science, history, writing, or just casual conversation. How can I assist you today? </pre>
// const robotMessagePre = document.createElement('pre')
// robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = "I'm a robot!"
// chatContent.append(robotMessagePre) // 服务端接口:http://127.0.0.1/api/chat
// 请求方法:POST
// 请求体:{"user_message": "Hi"}
// 响应体:{"robot_message": "Hello"} // fetch('/api/chat', {
// method: "POST",
// headers: { "Content-Type": "application/json" },
// body: JSON.stringify({ "user_message": userMessage })
// })
// .then(response => response.json())
// .then(data => {
// const robotMessagePre = document.createElement('pre')
// robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = data['robot_message']
// chatContent.append(robotMessagePre)
// }) const robotMessagePre = document.createElement('pre')
robotMessagePre.className = 'robot-message'
// robotMessagePre.textContent = "I'm a robot!"
chatContent.append(robotMessagePre)
const eventSource = new EventSource('/api/v2/chat?user_message=' + encodeURIComponent(userMessage))
eventSource.onmessage = (event) => {
console.log(event.data);
if (event.data == '[DONE]') {
eventSource.close()
sendBtn.disabled = false
} else {
robotMessagePre.textContent += JSON.parse(event.data)['chunk']
chatContent.scrollTop = chatContent.scrollHeight
}
}
}
}

deepseek-chatbot/app.py

from flask import Flask, render_template, request, Response
import requests
import json app = Flask(__name__) @app.route('/')
def home():
return render_template("index.html") @app.route('/api/chat', methods=['POST'])
def api_chat():
user_message = request.json.get('user_message') url = "https://api.deepseek.com/chat/completions" payload = json.dumps({
"messages": [
# {
# "content": "You are a software developer",
# "role": "system"
# },
{
"content": user_message, # Hello! How can I assist you today?
"role": "user" # 你好!很高兴见到你。你今天想学些什么中文呢?
} # Hello! How can I assist you today? Are you working on a coding project, or do you have a question about software development? Let me know!
],
"model": "deepseek-chat",
"n": 1
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-492ec2acc35c4d20b6ab2c9490fcef0d'
} response = requests.request("POST", url, headers=headers, data=payload) robot_message = response.json()['choices'][0]['message']['content']
return {"robot_message": robot_message} @app.route('/api/v2/chat')
def api_v2_chat():
user_message = request.args.get('user_message') url = "https://api.deepseek.com/chat/completions" payload = json.dumps({
"messages": [
{
"content": user_message,
"role": "user"
}
],
"model": "deepseek-chat",
"n": 1,
"stream": True
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-492ec2acc35c4d20b6ab2c9490fcef0d'
} response = requests.request("POST", url, headers=headers, data=payload, stream=True) # import time
def robot_message():
for line in response.iter_lines():
if not line:
continue
if line == b'data: [DONE]':
print("DONE")
yield "data: [DONE]\n\n"
else:
chunk = json.loads(line[6:])['choices'][0]['delta']['content']
if not chunk:
continue
print(chunk)
yield "data: " + json.dumps({'chunk': chunk}) + "\n\n"
# for chunk in ["I'm ", "a ", "robot"]:
# # yield chunk
# # yield "data: " + chunk + "\n\n"
# yield "data: " + json.dumps({'chunk': chunk}) + "\n\n"
# time.sleep(1)
# yield "data: [DONE]\n\n" return Response(robot_message(), content_type="text/event-stream") if __name__ == '__main__':
app.run(debug=True, port=80)

deepseek-chatbot/test.py

import requests
import json url = "https://api.deepseek.com/chat/completions" payload = json.dumps({
"messages": [
# {
# "content": "You are a software developer",
# "role": "system"
# },
{
"content": "Hi", # Hello! How can I assist you today?
"role": "user" # 你好!很高兴见到你。你今天想学些什么中文呢?
} # Hello! How can I assist you today? Are you working on a coding project, or do you have a question about software development? Let me know!
],
"model": "deepseek-chat",
"n": 1,
"stream": True
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer sk-492ec2acc35c4d20b6ab2c9490fcef0d'
} response = requests.request("POST", url, headers=headers, data=payload, stream=True)
print(response.status_code)
print(response.headers['Content-Type'])
# print(response.text)
# robot_message = response.json()['choices'][0]['message']['content'] for line in response.iter_lines():
# print(line)
if not line:
continue
if line == b'data: [DONE]':
print("DONE")
else:
chunk = json.loads(line[6:])['choices'][0]['delta']['content']
if not chunk:
continue
print(chunk) """
data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":"!"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" How"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" can"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" I"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" assist"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" you"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" today"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":"?"},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":" "},"logprobs":null,"finish_reason":null}]} data: {"id":"2da1725d-8eec-4612-a8da-e76cd896052b","object":"chat.completion.chunk","created":1742954476,"model":"deepseek-chat","system_fingerprint":"fp_3d5141a69a_prod0225","choices":[{"index":0,"delta":{"content":""},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":4,"completion_tokens":11,"total_tokens":15,"prompt_tokens_details":{"cached_tokens":0},"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":4}} data: [DONE] """

deepseek-chatbot/test.json

{
"id": "2da1725d-8eec-4612-a8da-e76cd896052b",
"object": "chat.completion.chunk",
"created": 1742954476,
"model": "deepseek-chat",
"system_fingerprint": "fp_3d5141a69a_prod0225",
"choices": [
{
"index": 0,
"delta": {
"content": "Hello"
},
"logprobs": null,
"finish_reason": null
}
]
}

DeepSeek 聊天机器人项目的更多相关文章

  1. 软工实践团队项目-"智能聊天机器人"简介

    "智能聊天机器人"项目 目前已确定的团队人员:张扬.俊彦.韫月.地秀.泽波.李翔.文婧.俞明.加伟(排名不分先后) 队伍已满,没有再招人的打算(#^.^#) 我们的想法 你有用过智 ...

  2. 聊天机器人框架Rasa资源整理

      Rasa是一个主流的构建对话机器人的开源框架,它的优点是几乎覆盖了对话系统的所有功能,并且每个模块都有很好的可扩展性.参考文献收集了一些Rasa相关的开源项目和优质文章. 一.Rasa介绍 1.R ...

  3. TensorFlow 聊天机器人开源项目评测第一期:DeepQA

    聊天机器人开源项目评测第一期:DeepQA https://github.com/Conchylicultor/DeepQA 用 i5 的笔记本早上运行到下午,跑了 3 轮的结果,最后效果并不理想.官 ...

  4. 开源项目——小Q聊天机器人V1.3

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  5. 开源项目——小Q聊天机器人V1.2

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  6. 开源项目——小Q聊天机器人V1.1

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  7. 开源项目——小Q聊天机器人V1.0

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  8. 开源项目——小Q聊天机器人V1.5

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  9. 开源项目——小Q聊天机器人V1.4

    小Q聊天机器人V1.0 http://blog.csdn.net/baiyuliang2013/article/details/51386281 小Q聊天机器人V1.1 http://blog.csd ...

  10. 深度学习项目——基于循环神经网络(RNN)的智能聊天机器人系统

    基于循环神经网络(RNN)的智能聊天机器人系统 本设计研究智能聊天机器人技术,基于循环神经网络构建了一套智能聊天机器人系统,系统将由以下几个部分构成:制作问答聊天数据集.RNN神经网络搭建.seq2s ...

随机推荐

  1. MyBatis的深入原理-架构设计以及实例分析

    MyBatis是目前非常流行的ORM框架,它的功能很强大,然而其实现却比较简单.优雅.本文主要讲述MyBatis的架构设计思路,并且讨论MyBatis的几个核心部件,然后结合一个select查询实例, ...

  2. 在OERV也可以玩MC(下)

      话接上回,上期讲述了在OERV安装HMCL的历程,这期讲讲HMCL的打包.   Show openEuler:24.09 / HMCL - 开源软件构建与测试.在这个网站里,可以看到有好几个文件, ...

  3. 2025 最佳免费商用文本转语音模型: Kokoro TTS

    在文本转语音(TTS)技术领域,一项突破性的进展引起了广泛关注--Kokoro TTS 模型凭借其卓越性能和完全免费的商用许可,成为目前最出色的 TTS 解决方案之一.基于广受欢迎的开源框架 Styl ...

  4. 面试题: == 和 equals() 区别【包装类重写了object类中的equals方法】

    /* * * 面试题: == 和 equals() 区别 * * 一.回顾 == 的使用: * == :运算符 * 1. 可以使用在基本数据类型变量和引用数据类型变量中 * 2. 如果比较的是基本数据 ...

  5. C#客户端Json转DataTable

    本文转自 https://blog.csdn.net/pinebud55/article/details/52240287 感谢pinebud55分享 之前我们有讨论过c#是如何处理json的,在我的 ...

  6. h5移动端像素适配 postcss-pxtorem和amfe-flexible

    Vant 中的样式默认使用px作为单位,如果需要使用rem单位,推荐使用以下两个工具: postcss-pxtorem 是一款 postcss 插件,用于将单位转化为 rem; amfe-flexib ...

  7. 本地部署最强人工智能服务:方案(一)Chatbox+硅基流动(满血DeepSeek R1)

    最近DeepSeek的服务器经常出现服务器繁忙,而且本地运行大模型很吃力,我的960m挺吃力的.不过华为后续和硅基流动一起搭建起了DeepSeek的API服务,注册就送14块钱,换算下来 4块/M t ...

  8. 探索未来之路,激发AI创新活力!“天翼云息壤杯”高校AI大赛北京区域赛开赛!

    近年来,人工智能发展速度之快.辐射范围之广令人瞩目.今年的<政府工作报告>提出,深化大数据.人工智能等研发应用,开展"人工智能+"行动.AI充满了无限可能和潜力,未来还 ...

  9. CRISP-DM的应用与理解

    本文分享自天翼云开发者社区<CRISP-DM的应用与理解>,作者:吴****嫄 CRISP-DM是一个数据挖掘项目规划的开放标准流程框架模型,主要分为业务理解.数据理解.数据准备.建模.评 ...

  10. Django项目与Vue的集成

    Django项目与Vue的集成 在现代Web开发领域,前后端分离已成为一种主流趋势.Django,作为一个强大的Python Web框架,以其丰富的功能和高度的可扩展性而受到开发者的青睐.而Vue.j ...