ceesroele / toxic_spans Goto Github PK
View Code? Open in Web Editor NEWToxic Span Detection with spaCy
License: MIT License
Toxic Span Detection with spaCy
License: MIT License
Hey,
at the outset: beautiful effort. It really saved me a lot of time from recoding the whole spancat pipeline.
However, i get the following error when running the run all command. Can you tell me what am I missing? am running your code as is, only difference is to save time/get to prediction faster, am running the training only for 2 epochs. Do you think that might be causing this problem?
(toxic) mitch@D21ML-MMITHUN toxic_spans % python run.py "Enter your toxic sentence here, my apologies for the example, you idiot"
Traceback (most recent call last):
File "/Users/mitch/research/piranha/toxic_spans/run.py", line 58, in <module>
run(args.input, spans_key=spans_key, model_reference=args.model_reference)
File "/Users/mitch/research/piranha/toxic_spans/run.py", line 17, in run
nlp = spacy.load(model_reference)
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/__init__.py", line 54, in load
return util.load_model(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/util.py", line 434, in load_model
return load_model_from_path(Path(name), **kwargs) # type: ignore[arg-type]
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/util.py", line 506, in load_model_from_path
nlp = load_model_from_config(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/util.py", line 554, in load_model_from_config
nlp = lang_cls.from_config(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/language.py", line 1818, in from_config
nlp.add_pipe(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/language.py", line 801, in add_pipe
pipe_component = self.create_pipe(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/language.py", line 680, in create_pipe
resolved = registry.resolve(cfg, validate=validate)
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/confection/__init__.py", line 728, in resolve
resolved, _ = cls._make(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/confection/__init__.py", line 777, in _make
filled, _, resolved = cls._fill(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/confection/__init__.py", line 832, in _fill
filled[key], validation[v_key], final[key] = cls._fill(
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/confection/__init__.py", line 831, in _fill
promise_schema = cls.make_promise_schema(value, resolve=resolve)
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/confection/__init__.py", line 1023, in make_promise_schema
func = cls.get(reg_name, func_name)
File "/Users/mitch/opt/miniconda3/envs/toxic/lib/python3.10/site-packages/spacy/util.py", line 139, in get
raise RegistryError(
catalogue.RegistryError: [E893] Could not find function 'spancat_char_scorer.v1' in function registry 'scorers'. If you're using a custom function, make sure the code is available. If the function is provided by a third-party package, e.g. spacy-transformers, make sure the package is installed in your environment.
Available names: spacy.attribute_ruler_scorer.v1, spacy.entity_linker_scorer.v1, spacy.entity_ruler_scorer.v1, spacy.lemmatizer_scorer.v1, spacy.morphologizer_scorer.v1, spacy.ner_scorer.v1, spacy.overlapping_labeled_spans_scorer.v1, spacy.parser_scorer.v1, spacy.senter_scorer.v1, spacy.spancat_scorer.v1, spacy.tagger_scorer.v1, spacy.textcat_multilabel_scorer.v1, spacy.textcat_scorer.v1```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.