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

ner_jsonl2json() got an unexpected keyword argument 'seg_sents' #4389

Closed
vitaly-d opened this issue Oct 7, 2019 · 2 comments
Closed

ner_jsonl2json() got an unexpected keyword argument 'seg_sents' #4389

vitaly-d opened this issue Oct 7, 2019 · 2 comments
Labels
bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface

Comments

@vitaly-d
Copy link

vitaly-d commented Oct 7, 2019

How to reproduce the behaviour

The 'jsonl2json' convertor fails with the "got an unexpected keyword argument" message:

To reproduce:
python -m spacy convert -c jsonl --lang en sample.jsonl /tmp

Nothing interesting within sample.jsonl, the behaviour does not depend on its content.

sample.jsonl.zip

After modifying the signature of ner_jsonl2json, my large dataset was converted without any issues:

(.env) vitaly@iMac spaCy % git diff
diff --git a/spacy/cli/converters/jsonl2json.py b/spacy/cli/converters/jsonl2json.py
index 91dd4298..c6abc487 100644
--- a/spacy/cli/converters/jsonl2json.py
+++ b/spacy/cli/converters/jsonl2json.py
@@ -7,7 +7,9 @@ from ...gold import docs_to_json
 from ...util import get_lang_class, minibatch
 
 
-def ner_jsonl2json(input_data, lang=None, n_sents=10, use_morphology=False):
+def ner_jsonl2json(
+    input_data, lang=None, n_sents=10, use_morphology=False, seg_sents=None, model=None
+):
     if lang is None:
         raise ValueError("No --lang specified, but tokenization required")
     json_docs = []

Your Environment

Info about spaCy

  • spaCy version: 2.2.1
  • Platform: Darwin-19.0.0-x86_64-i386-64bit
  • Python version: 3.7.3
@ines ines added bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface labels Oct 7, 2019
@honnibal
Copy link
Member

honnibal commented Oct 7, 2019

Thanks, it's hard to keep all of the CLI stuff tested. I think it's best to add a **kwargs catch-all, in case arguments are added for other converters that don't apply.

@ines ines closed this as completed in fd4a534 Oct 7, 2019
@lock
Copy link

lock bot commented Nov 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation feat / cli Feature: Command-line interface
Projects
None yet
Development

No branches or pull requests

3 participants