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

Bugfix initializing DocBin with attributes #4368

Merged
merged 3 commits into from Oct 3, 2019

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Oct 3, 2019

Description

We called intify_attrs() with a list instead of with a dictionary when creating a new DocBin. I created a small method intify_attr() that takes just one string argument to apply it quickly on lists.

I also added the example from the docs to the unit tests, and fixed a typo in the example.

Fixes #4367

Types of change

bug fix + documentation fix

Checklist

  • I have submitted the spaCy Contributor Agreement.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@svlandeg svlandeg added bug Bugs and behaviour differing from documentation docs Documentation and website feat / doc Feature: Doc, Span and Token objects feat / serialize Feature: Serialization, saving and loading labels Oct 3, 2019
@honnibal
Copy link
Member

honnibal commented Oct 3, 2019

Bloody Python 2.7 :(. I guess we need a spacy.compat function gzip_compress: https://docs.python.org/2/library/gzip.html

@honnibal
Copy link
Member

honnibal commented Oct 3, 2019

Ah, nice solution.

@honnibal honnibal merged commit 4e7259c into explosion:master Oct 3, 2019
@svlandeg svlandeg deleted the bugfix/doc-bin branch October 3, 2019 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation docs Documentation and website feat / doc Feature: Doc, Span and Token objects feat / serialize Feature: Serialization, saving and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DocBin's init has an issue with attrs as a list
2 participants