Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UIE model and fix NPTag preprocess bugs #2138

Merged
merged 4 commits into from
May 13, 2022

Conversation

linjieccc
Copy link
Contributor

@linjieccc linjieccc commented May 13, 2022

PR types

Bug fixes

PR changes

Description

  • 更新UIE模型,增加评价维度级情感倾向分类任务

Usage:

>>> from pprint import pprint
>>> from paddlenlp import Tsakflow

>>> schema = {'评价维度': ['观点词', '情感倾向[正向,负向]']}
>>> ie = Taskflow('information_extraction', schema=schema)
>>> pprint(ie("地址不错,服务一般,设施陈旧"))
[{'评价维度': [{'end': 2,
            'probability': 0.9888139270606509,
            'relations': {'情感倾向[正向,负向]': [{'probability': 0.998228967796706,
                                           'text': '正向'}],
                          '观点词': [{'end': 4,
                                   'probability': 0.9927847072459528,
                                   'start': 2,
                                   'text': '不错'}]},
            'start': 0,
            'text': '地址'},
           {'end': 12,
            'probability': 0.9588297379365116,
            'relations': {'情感倾向[正向,负向]': [{'probability': 0.9949389795770394,
                                           'text': '负向'}],
                          '观点词': [{'end': 14,
                                   'probability': 0.9286753967902683,
                                   'start': 12,
                                   'text': '陈旧'}]},
            'start': 10,
            'text': '设施'},
           {'end': 7,
            'probability': 0.9592857070501211,
            'relations': {'情感倾向[正向,负向]': [{'probability': 0.9952498258302498,
                                           'text': '负向'}],
                          '观点词': [{'end': 9,
                                   'probability': 0.9949359182521675,
                                   'start': 7,
                                   'text': '一般'}]},
            'start': 5,
            'text': '服务'}]}]
  • 修复NPTag预处理bug,Tokenizer返回实际文本长度

@ZeyuChen ZeyuChen merged commit a3ac5a9 into PaddlePaddle:develop May 13, 2022
@linjieccc linjieccc deleted the update_uie branch May 13, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants