mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 17:24:41 +03:00
Auto-format and fix tuple
This commit is contained in:
parent
e1b3e8ee11
commit
84fb3a3fb3
|
@ -28,7 +28,7 @@ CONVERTERS = {
|
||||||
|
|
||||||
|
|
||||||
# File types that can be written to stdout
|
# File types that can be written to stdout
|
||||||
FILE_TYPES_STDOUT = ("json")
|
FILE_TYPES_STDOUT = ("json",)
|
||||||
|
|
||||||
|
|
||||||
class FileTypes(str, Enum):
|
class FileTypes(str, Enum):
|
||||||
|
@ -86,20 +86,20 @@ def convert_cli(
|
||||||
|
|
||||||
|
|
||||||
def convert(
|
def convert(
|
||||||
input_path: Path,
|
input_path: Path,
|
||||||
output_dir: Path,
|
output_dir: Path,
|
||||||
*,
|
*,
|
||||||
file_type: str = "json",
|
file_type: str = "json",
|
||||||
n_sents: int = 1,
|
n_sents: int = 1,
|
||||||
seg_sents: bool = False,
|
seg_sents: bool = False,
|
||||||
model: Optional[str] = None,
|
model: Optional[str] = None,
|
||||||
morphology: bool = False,
|
morphology: bool = False,
|
||||||
merge_subtokens: bool = False,
|
merge_subtokens: bool = False,
|
||||||
converter: str = "auto",
|
converter: str = "auto",
|
||||||
ner_map: Optional[Path] = None,
|
ner_map: Optional[Path] = None,
|
||||||
lang: Optional[str] = None,
|
lang: Optional[str] = None,
|
||||||
silent: bool = True,
|
silent: bool = True,
|
||||||
msg: Optional[Path] = None,
|
msg: Optional[Path] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if not msg:
|
if not msg:
|
||||||
msg = Printer(no_print=silent)
|
msg = Printer(no_print=silent)
|
||||||
|
@ -149,7 +149,7 @@ def _write_docs_to_file(docs, output_file, output_type):
|
||||||
data = DocBin(docs=docs, store_user_data=True).to_bytes()
|
data = DocBin(docs=docs, store_user_data=True).to_bytes()
|
||||||
with output_file.open("wb") as file_:
|
with output_file.open("wb") as file_:
|
||||||
file_.write(data)
|
file_.write(data)
|
||||||
|
|
||||||
|
|
||||||
def autodetect_ner_format(input_data: str) -> str:
|
def autodetect_ner_format(input_data: str) -> str:
|
||||||
# guess format from the first 20 lines
|
# guess format from the first 20 lines
|
||||||
|
|
Loading…
Reference in New Issue
Block a user