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

Command Line -d option not working in v5.0.0 #178

Closed
hiroshi-matsuda-rit opened this issue Aug 26, 2021 · 1 comment
Closed

Command Line -d option not working in v5.0.0 #178

hiroshi-matsuda-rit opened this issue Aug 26, 2021 · 1 comment

Comments

@hiroshi-matsuda-rit
Copy link
Contributor

$ ginza -m ja_ginza -d
Traceback (most recent call last):
  File "/Users/matsuda/test/venv/bin/ginza", line 33, in <module>
    sys.exit(load_entry_point('ginza==5.0.0', 'console_scripts', 'ginza')())
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/ginza/command_line.py", line 489, in main_ginza
    plac.call(run_ginza)
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/plac_core.py", line 427, in call
    cmd, result = parser.consume(arglist)
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/plac_core.py", line 278, in consume
    return cmd, self.func(*(args + varargs + extraopts), **kwargs)
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/ginza/command_line.py", line 473, in run_ginza
    run(
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/ginza/command_line.py", line 79, in run
    analyzer.set_nlp()
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/ginza/command_line.py", line 205, in set_nlp
    nlp.add_pipe(disable_sentencizer, before="parser")
  File "/Users/matsuda/test/venv/lib/python3.9/site-packages/spacy/language.py", line 758, in add_pipe
    raise ValueError(err)
ValueError: [E966] `nlp.add_pipe` now takes the string name of the registered component factory, not a callable component. Expected string, but got <function Analyzer.set_nlp.<locals>.disable_sentencizer at 0x7fb393616940> (name: 'None').

- If you created your component with `nlp.create_pipe('name')`: remove nlp.create_pipe and call `nlp.add_pipe('name')` instead.

- If you passed in a component like `TextCategorizer()`: call `nlp.add_pipe` with the string name instead, e.g. `nlp.add_pipe('textcat')`.

- If you're using a custom component: Add the decorator `@Language.component` (for function components) or `@Language.factory` (for class components / factories) to your custom component and assign it a name, e.g. `@Language.component('your_name')`. You can then run `nlp.add_pipe('your_name')` to add it to the pipeline.
@hiroshi-matsuda-rit
Copy link
Contributor Author

Bug fixed

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

1 participant