Handsome_zhou 发表于 2022-3-11 18:24:28

基于词库的方法识别实体类别

import pandas as pd
import numpy as np

ciku_data = pd.read_csv('ciku.csv',header=None,names=['A','B'], encoding='utf-8')
A = ciku_data['A']
B = ciku_data['B']

dic = {"A":B,"A":B,"A":B,"A":B,"A":B,"A":B}


with open('example.txt','r',encoding='utf-8') as f:
    word_list = []
    for line in f:
      for word in line.split():
            word_list.append(word)
            
for i in range(len(word_list)):
    for j in range(len(A)):
      if word_list == A:
            print(A,B)
页: [1]
查看完整版本: 基于词库的方法识别实体类别