How to use the libratom.lib.constants.SPACY_MODELS.en_core_web_sm function in libratom

To help you get started, we’ve selected a few libratom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github libratom / libratom / tests / unit / test_cli.py View on Github external
def test_file_report(enron_dataset_part012):
    file = sorted(enron_dataset_part012.glob("*.pst"))[1]

    with tempfile.TemporaryDirectory() as tmpdir:

        out = Path(tmpdir) / "entities.sqlite3"

        # Extract entities
        assert 0 == subcommands.entities(
            out=out,
            spacy_model_name=SPACY_MODELS.en_core_web_sm,
            jobs=2,
            src=file,
            progress=False,
        )

        # Connect to DB file
        engine = create_engine(f"sqlite:////{out}")
        session = sessionmaker(bind=engine)()

        # There should be one FileReport instance for this run
        file_report = session.query(FileReport).one()  # pylint: disable=no-member

        # Path
        assert file_report.path == str(file)

        # Name
github libratom / libratom / libratom / cli / cli.py View on Github external
    default=SPACY_MODELS.en_core_web_sm,
)
@click.option(
    "-m",
    "--include-message-contents",
    is_flag=True,
    help="Also extract message headers and bodies.",
)
@click.option(
    "-j",
    "--jobs",
    metavar=INT_METAVAR,
    type=click.INT,
    help=f"Use {INT_METAVAR} concurrent jobs.",
    default=cpu_count(),
)
@click.argument(