SimmerChan / KG-demo-for-movie

从无到有构建一个电影知识图谱,并基于该KG,开发一个简易的KBQA程序。
https://zhuanlan.zhihu.com/knowledgegraph
1.28k stars 424 forks source link

cannot use a string pattern on a bytes-like object #3

Closed skyfully closed 5 years ago

skyfully commented 6 years ago

File "C:\Users\mynumber\Anaconda3\lib\site-packages\refo\virtualmachine.py", line 49, in feed if isinstance(self.pc, Accept) or not self.pc.comparison_function(x):

File "C:\Users\mynumber\KG-demo-for-movie\kg_demo_movie\KB_query\question_temp.py", line 62, in match m1 = self.token.match(word.token)

TypeError: cannot use a string pattern on a bytes-like object 在运行query_main时 出现如上错误这是什么原因呢??

SimmerChan commented 6 years ago

你是用的python3吧,decode一下应该就行了

zhengxiaoxuer commented 5 years ago

File "C:\Users\mynumber\Anaconda3\lib\site-packages\refo\virtualmachine.py", line 49, in feed if isinstance(self.pc, Accept) or not self.pc.comparison_function(x):

File "C:\Users\mynumber\KG-demo-for-movie\kg_demo_movie\KB_query\question_temp.py", line 62, in match m1 = self.token.match(word.token)

TypeError: cannot use a string pattern on a bytes-like object 在运行query_main时 出现如上错误这是什么原因呢??

请问你解决上述问题了吗,我也遇见这种问题,是因为python版本问题吗,那应该怎么修改呢

zhengxiaoxuer commented 5 years ago

你是用的python3吧,decode一下应该就行了

你好具体一点应该怎么改呢,我编程还很弱

SimmerChan commented 5 years ago

参考一下@jiangzhonglian python3分支