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

[Question]: UIE模型做信息抽取时如何设置嵌套关系的schema #8388

Open
lululiu2323 opened this issue May 8, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@lululiu2323
Copy link

请提出你的问题

我在用UIE-base模型做信息抽取,现在信息标注到抽取都跑通了,准确率也不错。但是,现在遇到个问题,我想设置嵌套关系的schema,但是好像UIE不支持,请问应该怎么调整?我想用“储层”作为“油田区块”的子实体,结果报错如下:

schema ={'油田区块': {'储层': ['地面原油密度', '地面原油粘度', '含硫量', '含蜡量']}}
ie.set_schema(schema)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.10/dist-packages/paddlenlp/taskflow/taskflow.py", line 862, in set_schema
self.task_instance.set_schema(schema)
File "/usr/local/lib/python3.10/dist-packages/paddlenlp/taskflow/information_extraction.py", line 549, in set_schema
self._schema_tree = self._build_tree(schema)
File "/usr/local/lib/python3.10/dist-packages/paddlenlp/taskflow/information_extraction.py", line 1307, in _build_tree
raise TypeError(
TypeError: Invalid schema, value for each key:value pairs should be list or stringbut <class 'dict'> received

@lululiu2323 lululiu2323 added the question Further information is requested label May 8, 2024
@w5688414
Copy link
Contributor

w5688414 commented May 10, 2024

UIE不支持嵌套实体识别,需要做一些后处理策略,目前没有相关的开发计划,欢迎开发者贡献。

#4503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants