MCPcopy
hub / github.com/explosion/spaCy / debug_data_cli

Function debug_data_cli

spacy/cli/debug_data.py:71–120  ·  view source on GitHub ↗

Analyze, debug and validate your training and development data. Outputs useful stats, and can help you find problems like invalid entity annotations, cyclic dependencies, low data labels and more. DOCS: https://spacy.io/api/cli#debug-data

(
    # fmt: off
    ctx: typer.Context,  # This is only used to read additional arguments
    config_path: Path = Arg(
        ..., help="Path to config file", exists=True, allow_dash=True
    ),
    code_path: Optional[Path] = Opt(
        None,
        "--code-path",
        "--code",
        "-c",
        help="Path to Python file with additional code (registered functions) to be imported",
    ),
    ignore_warnings: bool = Opt(
        False,
        "--ignore-warnings",
        "-IW",
        help="Ignore warnings, only show stats and errors",
    ),
    verbose: bool = Opt(
        False, "--verbose", "-V", help="Print additional information and explanations"
    ),
    no_format: bool = Opt(
        False, "--no-format", "-NF", help="Don't pretty-print the results"
    ),
    # fmt: on
)

Source from the content-addressed store, hash-verified

69 hidden=True, # hide this from main CLI help but still allow it to work with warning
70)
71def debug_data_cli(
72 # fmt: off
73 ctx: typer.Context, # This is only used to read additional arguments
74 config_path: Path = Arg(
75 ..., help="Path to config file", exists=True, allow_dash=True
76 ),
77 code_path: Optional[Path] = Opt(
78 None,
79 "--code-path",
80 "--code",
81 "-c",
82 help="Path to Python file with additional code (registered functions) to be imported",
83 ),
84 ignore_warnings: bool = Opt(
85 False,
86 "--ignore-warnings",
87 "-IW",
88 help="Ignore warnings, only show stats and errors",
89 ),
90 verbose: bool = Opt(
91 False, "--verbose", "-V", help="Print additional information and explanations"
92 ),
93 no_format: bool = Opt(
94 False, "--no-format", "-NF", help="Don't pretty-print the results"
95 ),
96 # fmt: on
97):
98 """
99 Analyze, debug and validate your training and development data. Outputs
100 useful stats, and can help you find problems like invalid entity annotations,
101 cyclic dependencies, low data labels and more.
102
103 DOCS: https://spacy.io/api/cli#debug-data
104 """
105 if ctx.command.name == "debug-data":
106 msg.warn(
107 "The debug-data command is now available via the 'debug data' "
108 "subcommand (without the hyphen). You can run python -m spacy debug "
109 "--help for an overview of the other available debugging commands."
110 )
111 overrides = parse_config_overrides(ctx.args)
112 import_code(code_path)
113 debug_data(
114 config_path,
115 config_overrides=overrides,
116 ignore_warnings=ignore_warnings,
117 verbose=verbose,
118 no_format=no_format,
119 silent=False,
120 )
121
122
123def debug_data(

Callers

nothing calls this directly

Calls 3

parse_config_overridesFunction · 0.85
import_codeFunction · 0.85
debug_dataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…