File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ format for tagging entities for NER.
77
88This repo is a simple converter that leverages ` spacy.gold.biluo_tags_from_offsets `
99and the SpaCy ` tokenizations ` repo that creates a 1-line function to convert spacy
10- formatted spans to ` ner_tags ` that can be fed into any Token Classification Transformer
10+ formatted spans to ` tokens ` and ` ner_tags ` that can be fed into any
11+ Token Classification Transformer
1112
1213## Installation
1314``` shell
1415pip install spacy-to-hf
15- pyenv rehash
1616python -m spacy download en_core_web_sm
1717````
1818
@@ -32,7 +32,7 @@ span_data = [
3232 }
3333]
3434hf_data = spacy_to_hf(span_data, " bert-base-cased" )
35- list(zip(hf_data[" tokens" ][0], hf_data[" ner_tags" ][0]))
35+ print( list(zip(hf_data[" tokens" ][0], hf_data[" ner_tags" ][0]) ))
3636ds = Dataset.from_dict(hf_data)
3737` ` `
3838
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ requires = [
66build-backend = " setuptools.build_meta"
77
88[project ]
9- name = " python_project_template "
9+ name = " spacy-to-hf "
1010dynamic = [" version" ]
1111readme = " README.md"
1212license = {text = ' Apache 2.0' }
@@ -86,11 +86,11 @@ exclude = '''
8686[tool .mypy ]
8787ignore_missing_imports = true
8888disallow_untyped_defs = true
89- mypy_path = [" python_project_template " , " tests" ]
89+ mypy_path = [" spacy_to_hf " , " tests" ]
9090exclude = [" dist" , " build" , " .venv" ]
9191
9292[tool .coverage .run ]
93- source = [" python_project_template " , " tests" ]
93+ source = [" spacy_to_hf " , " tests" ]
9494omit = [" *__init__.py" ]
9595parallel = true
9696
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ packages = find:
88include_package_data = True
99
1010[options.package_data]
11- python_project_template =
11+ spacy_to_hf =
1212 py.typed
1313
1414[options.packages.find]
Original file line number Diff line number Diff line change 1- __version__ = "0.0.0 "
1+ __version__ = "0.0.1 "
22
33from spacy_to_hf .conversion import spacy_to_hf
44
You can’t perform that action at this time.
0 commit comments