我正在使用Wit.ai创建一个聊天机器人,并试图实现一种更具有会话风格的交互方式。目前,我有几个故事,都需要一个位置才能发挥作用,但有些相关。下面是我现在如何与我的机器人交互的一个例子:
What is the weather in Los Angeles, CA?
Bot response
How many people live in Los Angeles, CA?
Bot response
但是我想让我的聊天机器人记住我说的是洛杉矶,所以互动看起来是这样的:
What is the weather in Los Angeles, CA?
Bot Response
How many p
我编写了一个在图中执行BFS的代码。但就在我给出第二个输入之后,它就崩溃了。有什么问题吗。我试着解决这个问题,但是它使程序的工作变得更简单了。
#include<iostream>
#include<vector>
#include<algorithm>
#include<deque>
using namespace std;
enum color{
white, gray, black
};
static const int nil=-2147483645;
class graph{
public:
i
我正在使用python的分数模块。
我试着得到接近2*5的分数。问题是,当我使用分数命令时,它不会返回我想要的内容,例如,在i=2中,返回的分数是146666667/1000000000,但我希望它返回17/12 (2*5的第三个近似)。我怎么能解决呢?
守则是:
ai=2
bi=1
n=5
for i in range(n):
ai=2+float(bi)/ai
F=fr.Fraction(str(ai-1))
print F
有人能帮帮我吗?