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

jupyter中如何显示 brat #6

Closed
jiangzhonglian opened this issue May 23, 2019 · 5 comments
Closed

jupyter中如何显示 brat #6

jiangzhonglian opened this issue May 23, 2019 · 5 comments

Comments

@jiangzhonglian
Copy link

我这边一直报错,请问小哥哥是怎么做到的?
image

@beader
Copy link
Owner

beader commented May 23, 2019

这个是 spacy 包的一个功能,你先去安装一下 spacy

我是用了 spacy 中的 displacy.render 来把标签渲染成 html。至于 jupyter 里面怎么把 html 渲染出来,可以手动去实现一个类的 _repr_html_ 方法,这个是 jupyter 特有的功能,详细可以参考这里
data_utils.py#L54

@jiangzhonglian
Copy link
Author

非常感谢🙏

@beader beader pinned this issue May 23, 2019
@jiangzhonglian
Copy link
Author

我测试了一下小哥哥的代码,依然报错

image

beader added a commit that referenced this issue May 24, 2019
[Displacy producing KeyError: 'settings' #3531](explosion/spaCy#3531)
Add `settings = {}` to `Sentence._repr_html_`
@beader
Copy link
Owner

beader commented May 24, 2019

帮你查了一下,这是 spacy 的一个 bug Displacy producing KeyError: 'settings' #3531

你 pull 一下 fix-displacy-keyrror-bug 这个分支,看看问题解决了没有

beader added a commit that referenced this issue May 28, 2019
[Displacy producing KeyError: 'settings' #3531](explosion/spaCy#3531)
Add `settings = {}` to `Sentence._repr_html_`
@beader beader closed this as completed May 28, 2019
@jiangzhonglian
Copy link
Author

问题解决了,非常谢谢小哥哥

@beader beader changed the title 小哥哥,jupyter中如何显示 brat jupyter中如何显示 brat Sep 23, 2019
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

No branches or pull requests

2 participants