string_segmentation.py 291 B

12345678910111213
  1. '''
  2. 将大语言模型生成的尾实体分割为list
  3. '''
  4. def tailSegmentation(tail):
  5. if '|' in tail:
  6. skills = tail.split('|')
  7. for skill in skills:
  8. if skill == '':
  9. skills.remove(skill)
  10. return skills
  11. else:
  12. return False