Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在mysql中将实体从数据库注释为给定文本的最快方法_Python_Mysql_Text - Fatal编程技术网

Python 在mysql中将实体从数据库注释为给定文本的最快方法

Python 在mysql中将实体从数据库注释为给定文本的最快方法,python,mysql,text,Python,Mysql,Text,我的数据库是 运动型:桌上型 id type 12 Cricket 人员:表 id name details 1 person1 he is good in cricket 2 person2 he is a player 我正在寻找在给定文本中识别已存储在我的数据库中的人员的方法示例: 我有文本作为 一个人的板球打得很好。人2是人1的朋友 所以当我提交sql查询时,我应该得到如下结果 一个人的板球打得很好。人2是人1的朋友 代码应该能够识别已经存储在我的数据

我的数据库是

运动型:桌上型

 id  type  
 12  Cricket
人员:表

id   name   details
1   person1  he is good in cricket
2   person2  he is a player
我正在寻找在给定文本中识别已存储在我的数据库中的人员的方法示例:

我有文本作为

一个人的板球打得很好。人2是人1的朋友

所以当我提交sql查询时,我应该得到如下结果

一个人的板球打得很好。人2是人1的朋友

代码应该能够识别已经存储在我的数据库中的项或实体


我应该如何在python和mysql的帮助下实现这一点?

您可以分割文本并为文本获取标记。然后将令牌列表与数据库中的表进行比较。到目前为止,您是否尝试过任何方法?