Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
spaCy | spaCy-master/.github/contributors/wxv.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,387 | 49.35514 | 82 | md |
spaCy | spaCy-master/.github/contributors/x-ji.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,315 | 48.682243 | 82 | md |
spaCy | spaCy-master/.github/contributors/xadrianzetx.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,367 | 49.641509 | 82 | md |
spaCy | spaCy-master/.github/contributors/xssChauhan.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,403 | 49.504673 | 82 | md |
spaCy | spaCy-master/.github/contributors/yanaiela.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,422 | 50.160377 | 83 | md |
spaCy | spaCy-master/.github/contributors/yaph.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,368 | 49.17757 | 82 | md |
spaCy | spaCy-master/.github/contributors/yashpatadia.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,367 | 49.641509 | 82 | md |
spaCy | spaCy-master/.github/contributors/yohasebe.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,368 | 49.17757 | 82 | md |
spaCy | spaCy-master/.github/contributors/yosiasz.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,368 | 49.17757 | 82 | md |
spaCy | spaCy-master/.github/contributors/yuukos.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,385 | 49.336449 | 82 | md |
spaCy | spaCy-master/.github/contributors/zaibacu.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,368 | 49.17757 | 82 | md |
spaCy | spaCy-master/.github/contributors/zhuorulin.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,420 | 49.663551 | 82 | md |
spaCy | spaCy-master/.github/contributors/zqhZY.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,431 | 49.766355 | 82 | md |
spaCy | spaCy-master/.github/contributors/zqianem.md | # spaCy contributor agreement
This spaCy Contributor Agreement (**"SCA"**) is based on the
[Oracle Contributor Agreement](http://www.oracle.com/technetwork/oca-405177.pdf).
The SCA applies to any contribution that you make to any product or project
managed by us (the **"project"**), and sets out the intellectual prope... | 5,368 | 49.17757 | 82 | md |
spaCy | spaCy-master/.github/workflows/explosionbot.yml | name: Explosion Bot
on:
issue_comment:
types:
- created
- edited
jobs:
explosion-bot:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTE... | 815 | 27.137931 | 102 | yml |
spaCy | spaCy-master/.github/workflows/gputests.yml | name: Weekly GPU tests
on:
schedule:
- cron: '0 1 * * MON'
jobs:
weekly-gputests:
strategy:
fail-fast: false
matrix:
branch: [master, v4]
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Trigger buildkite build
uses: buildkite/t... | 613 | 25.695652 | 86 | yml |
spaCy | spaCy-master/.github/workflows/issue-manager.yml | name: Issue Manager
on:
schedule:
- cron: "0 0 * * *"
issue_comment:
types:
- created
- edited
issues:
types:
- labeled
jobs:
issue-manager:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- uses: tiangolo/issue-manager@0.4.0
wit... | 1,296 | 34.054054 | 394 | yml |
spaCy | spaCy-master/.github/workflows/lock.yml | name: 'Lock Threads'
on:
schedule:
- cron: '0 0 * * *' # check every day
workflow_dispatch:
permissions:
issues: write
concurrency:
group: lock
jobs:
action:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
... | 596 | 21.111111 | 65 | yml |
spaCy | spaCy-master/.github/workflows/slowtests.yml | name: Daily slow tests
on:
schedule:
- cron: '0 0 * * *'
jobs:
daily-slowtests:
strategy:
fail-fast: false
matrix:
branch: [master, v4]
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
... | 1,173 | 29.102564 | 80 | yml |
spaCy | spaCy-master/.github/workflows/spacy_universe_alert.yml | name: spaCy universe project alert
on:
pull_request_target:
paths:
- "website/meta/universe.json"
jobs:
build:
if: github.repository_owner == 'explosion'
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
PR... | 908 | 25.735294 | 66 | yml |
spaCy | spaCy-master/.github/workflows/tests.yml | name: tests
on:
push:
branches-ignore:
- "spacy.io"
- "nightly.spacy.io"
- "v2.spacy.io"
paths-ignore:
- "*.md"
- "*.mdx"
- "website/**"
- ".github/workflows/**"
pull_request:
types: [opened, synchronize, reopened, edited]
paths-ignore:
- "*.md"
... | 5,961 | 32.307263 | 176 | yml |
spaCy | spaCy-master/.github/workflows/universe_validation.yml | name: universe validation
on:
push:
branches-ignore:
- "spacy.io"
- "nightly.spacy.io"
- "v2.spacy.io"
paths:
- "website/meta/universe.json"
pull_request:
types: [opened, synchronize, reopened, edited]
paths:
- "website/meta/universe.json"
jobs:
validate:
name: ... | 773 | 21.764706 | 77 | yml |
spaCy | spaCy-master/bin/get-package.sh | #!/usr/bin/env bash
set -e
version=$(grep "__title__ = " spacy/about.py)
version=${version/__title__ = }
version=${version/\'/}
version=${version/\'/}
version=${version/\"/}
version=${version/\"/}
echo $version
| 214 | 15.538462 | 45 | sh |
spaCy | spaCy-master/bin/get-version.sh | #!/usr/bin/env bash
set -e
version=$(grep "__version__ = " spacy/about.py)
version=${version/__version__ = }
version=${version/\'/}
version=${version/\'/}
version=${version/\"/}
version=${version/\"/}
echo $version
| 218 | 15.846154 | 47 | sh |
spaCy | spaCy-master/bin/push-tag.sh | #!/usr/bin/env bash
set -e
# Insist repository is clean
git diff-index --quiet HEAD
git checkout $1
git pull origin $1
git push origin $1
version=$(grep "__version__ = " spacy/about.py)
version=${version/__version__ = }
version=${version/\'/}
version=${version/\'/}
version=${version/\"/}
version=${version/\"/}
git ... | 364 | 17.25 | 47 | sh |
spaCy | spaCy-master/examples/README.md | <a href="https://explosion.ai"><img src="https://explosion.ai/assets/img/logo.svg" width="125" height="125" align="right" /></a>
# spaCy examples
For spaCy v3 we've converted many of the [v2 example
scripts](https://github.com/explosion/spaCy/tree/v2.3.x/examples/) into
end-to-end [spacy projects](https://spacy.io/us... | 5,465 | 40.725191 | 227 | md |
spaCy | spaCy-master/examples/training/README.md | <a href="https://explosion.ai"><img src="https://explosion.ai/assets/img/logo.svg" width="125" height="125" align="right" /></a>
# spaCy examples
See [examples/README.md](../README.md)
| 187 | 30.333333 | 128 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/Code Conventions.md | # Code Conventions
For a general overview of code conventions for contributors, see the [section in the contributing guide](https://github.com/explosion/spaCy/blob/master/CONTRIBUTING.md#code-conventions).
1. [Code compatibility](#code-compatibility)
2. [Auto-formatting](#auto-formatting)
3. [Linting](#linting)
4. [D... | 37,438 | 63.438898 | 754 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/ExplosionBot.md | # Explosion-bot
Explosion-bot is a robot that can be invoked to help with running particular test commands.
## Permissions
Only maintainers have permissions to summon explosion-bot. Each of the open source repos that use explosion-bot has its own team(s) of maintainers, and only github users who are members of those... | 2,648 | 45.473684 | 308 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/Language.md | # Language
> Reference: `spacy/language.py`
1. [Constructing the `nlp` object from a config](#1-constructing-the-nlp-object-from-a-config)
- [A. Overview of `Language.from_config`](#1a-overview)
- [B. Component factories](#1b-how-pipeline-component-factories-work-in-the-config)
- [C. Sourcing a component](#1... | 20,048 | 131.774834 | 744 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/Listeners.md | # Listeners
1. [Overview](#1-overview)
2. [Initialization](#2-initialization)
- [A. Linking listeners to the embedding component](#2a-linking-listeners-to-the-embedding-component)
- [B. Shape inference](#2b-shape-inference)
3. [Internal communication](#3-internal-communication)
- [A. During prediction](#3a-du... | 12,429 | 55.244344 | 131 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/README.md | <a href="https://explosion.ai"><img src="https://explosion.ai/assets/img/logo.svg" width="125" height="125" align="right" /></a>
# Developer Documentation
This directory includes additional documentation and explanations of spaCy's internals. It's mostly intended for the spaCy core development team and contributors i... | 818 | 101.375 | 480 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/Satellite Packages.md | # spaCy Satellite Packages
This is a list of all the active repos relevant to spaCy besides the main one, with short descriptions, history, and current status. Archived repos will not be covered.
## Always Included in spaCy
These packages are always pulled in when you install spaCy. Most of them are direct dependenc... | 10,232 | 122.289157 | 487 | md |
spaCy | spaCy-master/extra/DEVELOPER_DOCS/StringStore-Vocab.md | # StringStore & Vocab
> Reference: `spacy/strings.pyx`
> Reference: `spacy/vocab.pyx`
## Overview
spaCy represents mosts strings internally using a `uint64` in Cython which
corresponds to a hash. The magic required to make this largely transparent is
handled by the `StringStore`, and is integrated into the pipelines... | 9,087 | 40.880184 | 195 | md |
spaCy | spaCy-master/extra/example_data/ner_example_data/README.md | ## Examples of NER/IOB data that can be converted with `spacy convert`
To convert an IOB file to `.spacy` ([`DocBin`](https://spacy.io/api/docbin))
for spaCy v3:
```bash
python -m spacy convert -c iob -s -n 10 -b en_core_web_sm file.iob .
```
See all the `spacy convert` options: https://spacy.io/api/cli#convert
---... | 608 | 22.423077 | 76 | md |
spaCy | spaCy-master/extra/example_data/textcat_example_data/README.md | ## Examples of textcat training data
spacy JSON training files were generated from JSONL with:
```
python textcatjsonl_to_trainjson.py -m en file.jsonl .
```
`cooking.json` is an example with mutually-exclusive classes with two labels:
* `baking`
* `not_baking`
`jigsaw-toxic-comment.json` is an example with multip... | 1,037 | 28.657143 | 84 | md |
spaCy | spaCy-master/extra/example_data/textcat_example_data/textcatjsonl_to_trainjson.py | from pathlib import Path
import plac
import spacy
from spacy.training import docs_to_json
import srsly
import sys
@plac.annotations(
model=("Model name. Defaults to 'en'.", "option", "m", str),
input_file=("Input file (jsonl)", "positional", None, Path),
output_dir=("Output directory", "positional", None,... | 1,554 | 26.767857 | 88 | py |
spaCy | spaCy-master/spacy/__init__.py | import sys
from pathlib import Path
from typing import Any, Dict, Iterable, Union
# set library-specific custom warning handling before doing anything else
from .errors import setup_default_warnings
setup_default_warnings() # noqa: E402
# These are imported as part of the API
from thinc.api import Config, prefer_gp... | 2,931 | 35.65 | 94 | py |
spaCy | spaCy-master/spacy/__main__.py | if __name__ == "__main__":
from spacy.cli import setup_cli
setup_cli()
| 80 | 15.2 | 35 | py |
spaCy | spaCy-master/spacy/about.py | # fmt: off
__title__ = "spacy"
__version__ = "3.6.0"
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
__projects__ = "https://github.com/explosion/projects"
__projects_branch__ = "v3"... | 321 | 39.25 | 104 | py |
spaCy | spaCy-master/spacy/compat.py | """Helpers for Python and platform compatibility."""
import sys
from thinc.util import copy_array
try:
import cPickle as pickle
except ImportError:
import pickle # type: ignore[no-redef]
try:
import copy_reg
except ImportError:
import copyreg as copy_reg # type: ignore[no-redef]
try:
from cupy... | 1,347 | 25.96 | 109 | py |
spaCy | spaCy-master/spacy/errors.py | import warnings
from .compat import Literal
class ErrorsWithCodes(type):
def __getattribute__(self, code):
msg = super().__getattribute__(code)
if code.startswith("__"): # python system attributes like __class__
return msg
else:
return "[{code}] {msg}".format(code... | 67,590 | 65.855589 | 120 | py |
spaCy | spaCy-master/spacy/glossary.py | import warnings
from .errors import Warnings
def explain(term):
"""Get a description for a given POS tag, dependency label or entity type.
term (str): The term to explain.
RETURNS (str): The explanation, or `None` if not found in the glossary.
EXAMPLE:
>>> spacy.explain(u'NORP')
>>>... | 13,158 | 35.451524 | 141 | py |
spaCy | spaCy-master/spacy/language.py | import functools
import itertools
import multiprocessing as mp
import random
import traceback
import warnings
from contextlib import contextmanager
from copy import deepcopy
from dataclasses import dataclass
from itertools import chain, cycle
from pathlib import Path
from timeit import default_timer as timer
from typin... | 101,633 | 42.451903 | 125 | py |
spaCy | spaCy-master/spacy/lookups.py | from collections import OrderedDict
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import srsly
from preshed.bloom import BloomFilter
from .errors import Errors
from .strings import get_string_id
from .util import SimpleFrozenDict, ensure_path, load_language_data, registry
UNSET = objec... | 10,851 | 33.450794 | 91 | py |
spaCy | spaCy-master/spacy/pipe_analysis.py | from typing import TYPE_CHECKING, Dict, ItemsView, Iterable, List, Set, Union
from wasabi import msg
from .errors import Errors
from .tokens import Doc, Span, Token
from .util import dot_to_dict
if TYPE_CHECKING:
# This lets us add type hints for mypy etc. without causing circular imports
from .language impo... | 6,242 | 43.913669 | 88 | py |
spaCy | spaCy-master/spacy/schemas.py | import inspect
import re
from collections import defaultdict
from enum import Enum
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Tuple,
Type,
TypeVar,
Union,
)
from pydantic import (
BaseModel,
ConstrainedStr,
Field,
Stric... | 23,946 | 40.35924 | 179 | py |
spaCy | spaCy-master/spacy/scorer.py | from collections import defaultdict
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
Tuple,
)
import numpy as np
from .errors import Errors
from .morphology import Morphology
from .tokens import Doc, Span, Token
from .training import Example
f... | 41,455 | 39.092843 | 101 | py |
spaCy | spaCy-master/spacy/ty.py | from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Sequence,
)
from thinc.api import Model, Optimizer
from .compat import Protocol, runtime_checkable
if TYPE_CHECKING:
from .language import Language
from .training import Example
@runtime_check... | 1,345 | 19.393939 | 76 | py |
spaCy | spaCy-master/spacy/util.py | import functools
import importlib
import importlib.util
import inspect
import itertools
import logging
import os
import pkgutil
import re
import shlex
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import warnings
from collections import defaultdict
from contextlib import contextma... | 67,338 | 35.617183 | 128 | py |
spaCy | spaCy-master/spacy/cli/__init__.py | from wasabi import msg
from ._util import app, setup_cli # noqa: F401
from .apply import apply # noqa: F401
from .assemble import assemble_cli # noqa: F401
# These are the actual functions, NOT the wrapped CLI commands. The CLI commands
# are registered automatically and won't have to be imported here.
from .bench... | 1,988 | 45.255814 | 91 | py |
spaCy | spaCy-master/spacy/cli/_util.py | import hashlib
import os
import shutil
import sys
from configparser import InterpolationError
from contextlib import contextmanager
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
List,
Optional,
Tuple,
Union,
overload,
)
import srsly
import typer
f... | 24,384 | 37.101563 | 106 | py |
spaCy | spaCy-master/spacy/cli/apply.py | from itertools import chain
from pathlib import Path
from typing import Iterable, List, Optional, Union, cast
import srsly
import tqdm
from wasabi import msg
from ..tokens import Doc, DocBin
from ..util import ensure_path, load_model
from ..vocab import Vocab
from ._util import Arg, Opt, app, import_code, setup_gpu, ... | 4,842 | 33.347518 | 98 | py |
spaCy | spaCy-master/spacy/cli/assemble.py | import logging
from pathlib import Path
from typing import Optional
import typer
from wasabi import msg
from .. import util
from ..util import get_sourced_components, load_model_from_config
from ._util import (
Arg,
Opt,
app,
import_code,
parse_config_overrides,
show_validation_error,
)
@app... | 2,586 | 38.8 | 145 | py |
spaCy | spaCy-master/spacy/cli/benchmark_speed.py | import random
import time
from itertools import islice
from pathlib import Path
from typing import Iterable, List, Optional
import numpy
import typer
from tqdm import tqdm
from wasabi import msg
from .. import util
from ..language import Language
from ..tokens import Doc
from ..training import Corpus
from ._util impo... | 5,218 | 28.653409 | 123 | py |
spaCy | spaCy-master/spacy/cli/convert.py | import itertools
import re
import sys
from enum import Enum
from pathlib import Path
from typing import Any, Callable, Iterable, Mapping, Optional, Union
import srsly
from wasabi import Printer
from ..tokens import Doc, DocBin
from ..training import docs_to_json
from ..training.converters import (
conll_ner_to_do... | 9,389 | 35.823529 | 154 | py |
spaCy | spaCy-master/spacy/cli/debug_config.py | from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import typer
from thinc.api import Config
from thinc.config import VARIABLE_RE
from wasabi import msg, table
from .. import util
from ..schemas import ConfigSchemaInit, ConfigSchemaTraining
from ..util import registry
from ._util import (
... | 4,558 | 38.991228 | 200 | py |
spaCy | spaCy-master/spacy/cli/debug_data.py | import math
import sys
from collections import Counter
from pathlib import Path
from typing import (
Any,
Dict,
Iterable,
List,
Optional,
Sequence,
Set,
Tuple,
Union,
cast,
overload,
)
import numpy
import srsly
import typer
from wasabi import MESSAGES, Printer, msg
from .. ... | 50,253 | 39.757502 | 160 | py |
spaCy | spaCy-master/spacy/cli/debug_diff.py | from pathlib import Path
from typing import Optional
import typer
from thinc.api import Config
from wasabi import MarkdownRenderer, Printer, diff_strings
from ..util import load_config
from ._util import Arg, Opt, debug_cli, parse_config_overrides, show_validation_error
from .init_config import Optimizations, init_co... | 3,580 | 38.788889 | 217 | py |
spaCy | spaCy-master/spacy/cli/debug_model.py | import itertools
from pathlib import Path
from typing import Any, Dict, Optional
import typer
from thinc.api import (
Model,
data_validation,
fix_random_seed,
set_dropout_rate,
set_gpu_allocator,
)
from wasabi import msg
from spacy.training import Example
from spacy.util import resolve_dot_names
... | 8,929 | 35.748971 | 129 | py |
spaCy | spaCy-master/spacy/cli/download.py | import sys
from typing import Optional, Sequence
import requests
import typer
from wasabi import msg
from .. import about
from ..errors import OLD_MODEL_SHORTCUTS
from ..util import get_minor_version, is_package, is_prerelease_version, run_command
from ._util import SDIST_SUFFIX, WHEEL_SUFFIX, Arg, Opt, app
@app.co... | 4,648 | 34.219697 | 121 | py |
spaCy | spaCy-master/spacy/cli/evaluate.py | import re
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import srsly
from thinc.api import fix_random_seed
from wasabi import Printer
from .. import displacy, util
from ..scorer import Scorer
from ..tokens import Doc
from ..training import Corpus
from ._util import Arg, Opt, app, benchm... | 9,274 | 36.1 | 154 | py |
spaCy | spaCy-master/spacy/cli/find_threshold.py | import functools
import logging
import operator
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import numpy
import wasabi.tables
from .. import util
from ..errors import Errors
from ..pipeline import MultiLabel_TextCategorizer, TextCategorizer
from ..training import Corpus
from ._util im... | 9,380 | 39.089744 | 145 | py |
spaCy | spaCy-master/spacy/cli/info.py | import json
import platform
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import srsly
from wasabi import MarkdownRenderer, Printer
from .. import about, util
from ..compat import importlib_metadata
from ._util import Arg, Opt, app, string_to_list
from .download import get_latest_versio... | 6,330 | 32.146597 | 127 | py |
spaCy | spaCy-master/spacy/cli/init_config.py | import re
from enum import Enum
from pathlib import Path
from typing import List, Optional, Tuple
import srsly
from jinja2 import Template
from thinc.api import Config
from wasabi import Printer, diff_strings
from .. import util
from ..language import DEFAULT_CONFIG_PRETRAIN_PATH
from ..schemas import RecommendationS... | 10,391 | 39.913386 | 329 | py |
spaCy | spaCy-master/spacy/cli/init_pipeline.py | import logging
from pathlib import Path
from typing import Optional
import srsly
import typer
from wasabi import msg
from .. import util
from ..language import Language
from ..training.initialize import convert_vectors, init_nlp
from ._util import (
Arg,
Opt,
import_code,
init_cli,
parse_config_ov... | 5,796 | 40.407143 | 145 | py |
spaCy | spaCy-master/spacy/cli/package.py | import re
import shutil
import sys
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import srsly
from catalogue import RegistryError
from thinc.api import Config
from wasabi import MarkdownRenderer, Printer, get_raw_input
from .. import abou... | 21,372 | 37.371634 | 165 | py |
spaCy | spaCy-master/spacy/cli/pretrain.py | import re
from pathlib import Path
from typing import Optional
import typer
from wasabi import msg
from ..training.pretrain import pretrain
from ..util import load_config
from ._util import (
Arg,
Opt,
app,
import_code,
parse_config_overrides,
setup_gpu,
show_validation_error,
)
@app.com... | 5,276 | 40.880952 | 195 | py |
spaCy | spaCy-master/spacy/cli/profile.py | import cProfile
import itertools
import pstats
import sys
from pathlib import Path
from typing import Iterator, Optional, Sequence, Union
import srsly
import tqdm
import typer
from wasabi import Printer, msg
from ..language import Language
from ..util import load_model
from ._util import NAME, Arg, Opt, app, debug_cl... | 3,453 | 36.139785 | 116 | py |
spaCy | spaCy-master/spacy/cli/train.py | import logging
import sys
from pathlib import Path
from typing import Any, Dict, Optional, Union
import typer
from wasabi import msg
from .. import util
from ..training.initialize import init_nlp
from ..training.loop import train as train_nlp
from ._util import (
Arg,
Opt,
app,
import_code,
parse_... | 3,415 | 39.666667 | 145 | py |
spaCy | spaCy-master/spacy/cli/validate.py | import sys
import warnings
from pathlib import Path
from typing import Tuple
import requests
from wasabi import Printer, msg
from .. import about
from ..util import (
get_installed_models,
get_minor_version,
get_model_meta,
get_package_path,
get_package_version,
is_compatible_version,
)
from .... | 4,587 | 36 | 107 | py |
spaCy | spaCy-master/spacy/cli/project/__init__.py | 0 | 0 | 0 | py | |
spaCy | spaCy-master/spacy/cli/project/assets.py | import os
import re
import shutil
from pathlib import Path
from typing import Any, Dict, Optional
import requests
import typer
from wasabi import msg
from ...util import ensure_path, working_dir
from .._util import (
PROJECT_FILE,
Arg,
Opt,
SimpleFrozenDict,
download_file,
get_checksum,
ge... | 8,220 | 36.711009 | 181 | py |
spaCy | spaCy-master/spacy/cli/project/clone.py | import re
import subprocess
from pathlib import Path
from typing import Optional
from wasabi import msg
from ... import about
from ...util import ensure_path
from .._util import (
COMMAND,
PROJECT_FILE,
Arg,
Opt,
get_git_version,
git_checkout,
git_repo_branch_exists,
project_cli,
)
DE... | 4,773 | 37.192 | 155 | py |
spaCy | spaCy-master/spacy/cli/project/document.py | from pathlib import Path
from wasabi import MarkdownRenderer, msg
from ...util import working_dir
from .._util import PROJECT_FILE, Arg, Opt, load_project_config, project_cli
DOCS_URL = "https://spacy.io"
INTRO_PROJECT = f"""The [`{PROJECT_FILE}`]({PROJECT_FILE}) defines the data assets required by the
project, as w... | 5,125 | 43.189655 | 141 | py |
spaCy | spaCy-master/spacy/cli/project/dvc.py | """This module contains helpers and subcommands for integrating spaCy projects
with Data Version Controk (DVC). https://dvc.org"""
import subprocess
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional
from wasabi import msg
from ...util import (
SimpleFrozenList,
join_command,
... | 8,567 | 37.769231 | 148 | py |
spaCy | spaCy-master/spacy/cli/project/pull.py | from pathlib import Path
from wasabi import msg
from .._util import Arg, load_project_config, logger, project_cli
from .remote_storage import RemoteStorage, get_command_hash
from .run import update_lockfile
@project_cli.command("pull")
def project_pull_cli(
# fmt: off
remote: str = Arg("default", help="Name... | 2,898 | 41.632353 | 148 | py |
spaCy | spaCy-master/spacy/cli/project/push.py | from pathlib import Path
from wasabi import msg
from .._util import Arg, load_project_config, logger, project_cli
from .remote_storage import RemoteStorage, get_command_hash, get_content_hash
@project_cli.command("push")
def project_push_cli(
# fmt: off
remote: str = Arg("default", help="Name or path of rem... | 2,730 | 38.014286 | 148 | py |
spaCy | spaCy-master/spacy/cli/project/remote_storage.py | import hashlib
import os
import site
import tarfile
import urllib.parse
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Optional
from wasabi import msg
from ... import about
from ...errors import Errors
from ...git_info import GIT_VERSION
from ...util import ENV_VARS, check_bool_env_var, get_mi... | 8,247 | 37.723005 | 88 | py |
spaCy | spaCy-master/spacy/cli/project/run.py | import os.path
import sys
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple
import srsly
import typer
from wasabi import msg
from wasabi.util import locale_escape
from ... import about
from ...git_info import GIT_VERSION
from ...util import (
ENV_VARS,
SimpleFroz... | 15,871 | 40.768421 | 148 | py |
spaCy | spaCy-master/spacy/cli/templates/quickstart_training_recommendations.yml | # Recommended settings and available resources for each language, if available.
# Not all languages have recommended word vectors or transformers and for some,
# the recommended transformer for efficiency and accuracy may be the same.
__default__:
word_vectors: null
transformer:
efficiency:
name: bert-bas... | 6,294 | 21.243816 | 79 | yml |
spaCy | spaCy-master/spacy/displacy/__init__.py | """
spaCy's built in visualization suite for dependencies and named entities.
DOCS: https://spacy.io/api/top-level#displacy
USAGE: https://spacy.io/usage/visualizers
"""
import warnings
from typing import Any, Callable, Dict, Iterable, Optional, Union
from ..errors import Errors, Warnings
from ..tokens import Doc, Sp... | 10,337 | 36.18705 | 95 | py |
spaCy | spaCy-master/spacy/displacy/render.py | import uuid
from typing import Any, Dict, List, Optional, Tuple, Union
from ..errors import Errors
from ..util import escape_html, minify_html, registry
from .templates import (
TPL_DEP_ARCS,
TPL_DEP_SVG,
TPL_DEP_WORDS,
TPL_DEP_WORDS_LEMMA,
TPL_ENT,
TPL_ENT_RTL,
TPL_ENTS,
TPL_FIGURE,
... | 23,772 | 39.225042 | 93 | py |
spaCy | spaCy-master/spacy/displacy/templates.py | # Setting explicit height and max-width: none on the SVG is required for
# Jupyter to render it properly in a cell
TPL_DEP_SVG = """
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="{lang}" id="{id}" class="displacy" width="{width}" height="{height}" direction="{dir}" style=... | 4,656 | 34.823077 | 312 | py |
spaCy | spaCy-master/spacy/kb/__init__.py | from .candidate import Candidate, get_candidates, get_candidates_batch
from .kb import KnowledgeBase
from .kb_in_memory import InMemoryLookupKB
| 144 | 35.25 | 70 | py |
spaCy | spaCy-master/spacy/lang/__init__.py | 0 | 0 | 0 | py | |
spaCy | spaCy-master/spacy/lang/char_classes.py | split_chars = lambda char: list(char.strip().split(" "))
merge_chars = lambda char: char.strip().replace(" ", "|")
group_chars = lambda char: char.strip().replace(" ", "")
_ethiopic = r"\u1200-\u137F"
_bengali = r"\u0980-\u09FF"
_hebrew = r"\u0591-\u05F4\uFB1D-\uFB4F"
_hindi = r"\u0900-\u097F"
_kannada = r"\u0C80-... | 14,221 | 41.580838 | 110 | py |
spaCy | spaCy-master/spacy/lang/lex_attrs.py | import re
import unicodedata
from typing import Set
from .. import attrs
from .tokenizer_exceptions import URL_MATCH
_like_email = re.compile(r"([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)").match
_tlds = set(
"com|org|edu|gov|net|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|"
"name|pro|tel|travel... | 5,888 | 26.518692 | 110 | py |
spaCy | spaCy-master/spacy/lang/norm_exceptions.py | # These exceptions are used to add NORM values based on a token's ORTH value.
# Individual languages can also add their own exceptions and overwrite them -
# for example, British vs. American spelling in English.
# Norms are only set if no alternative is provided in the tokenizer exceptions.
# Note that this does not ... | 1,355 | 21.6 | 79 | py |
spaCy | spaCy-master/spacy/lang/punctuation.py | from .char_classes import (
ALPHA,
ALPHA_LOWER,
ALPHA_UPPER,
COMBINING_DIACRITICS,
CONCAT_QUOTES,
CURRENCY,
HYPHENS,
LIST_CURRENCY,
LIST_ELLIPSES,
LIST_ICONS,
LIST_PUNCT,
LIST_QUOTES,
PUNCT,
UNITS,
)
TOKENIZER_PREFIXES = (
["§", "%", "=", "—", "–", r"\+(?![0-... | 2,187 | 26.696203 | 85 | py |
spaCy | spaCy-master/spacy/lang/tokenizer_exceptions.py | import re
from ..symbols import NORM, ORTH
from .char_classes import ALPHA_LOWER
# URL validation regex courtesy of: https://mathiasbynens.be/demo/url-regex
# and https://gist.github.com/dperini/729294 (Diego Perini, MIT License)
# A few mods to this regex to account for use cases represented in test_urls
URL_PATTERN... | 3,432 | 12.306202 | 79 | py |
spaCy | spaCy-master/spacy/lang/af/__init__.py | from ...language import BaseDefaults, Language
from .stop_words import STOP_WORDS
class AfrikaansDefaults(BaseDefaults):
stop_words = STOP_WORDS
class Afrikaans(Language):
lang = "af"
Defaults = AfrikaansDefaults
__all__ = ["Afrikaans"]
| 255 | 16.066667 | 46 | py |
spaCy | spaCy-master/spacy/lang/af/stop_words.py | # Source: https://github.com/stopwords-iso/stopwords-af
STOP_WORDS = set(
"""
'n
aan
af
al
as
baie
by
daar
dag
dat
die
dit
een
ek
en
gaan
gesê
haar
het
hom
hulle
hy
in
is
jou
jy
kan
kom
ma
maar
met
my
na
nie
om
ons
op
saam
sal
se
sien
so
sy
te
toe
uit
van
vir
was
wat
ʼn
""".split()
)
| 289 | 4 | 55 | py |
spaCy | spaCy-master/spacy/lang/am/__init__.py | from ...attrs import LANG
from ...language import BaseDefaults, Language
from ...util import update_exc
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .stop_words import STOP_WORDS
from .tokenizer_exceptions import TOKENIZER_EXCEPTION... | 830 | 29.777778 | 81 | py |
spaCy | spaCy-master/spacy/lang/am/examples.py | """
Example sentences to test spaCy and its language models.
>>> from spacy.lang.am.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"አፕል የዩኬን ጅምር ድርጅት በ 1 ቢሊዮን ዶላር ለመግዛት አስቧል።",
"የራስ ገዝ መኪኖች የኢንሹራንስ ኃላፊነትን ወደ አምራቾች ያዛውራሉ",
"ሳን ፍራንሲስኮ የእግረኛ መንገድ አቅርቦት ሮቦቶችን ማገድን ይመለከታል",
"ለን... | 444 | 22.421053 | 56 | py |
spaCy | spaCy-master/spacy/lang/am/lex_attrs.py | from ...attrs import LIKE_NUM
_num_words = [
"ዜሮ",
"አንድ",
"ሁለት",
"ሶስት",
"አራት",
"አምስት",
"ስድስት",
"ሰባት",
"ስምት",
"ዘጠኝ",
"አስር",
"አስራ አንድ",
"አስራ ሁለት",
"አስራ ሶስት",
"አስራ አራት",
"አስራ አምስት",
"አስራ ስድስት",
"አስራ ሰባት",
"አስራ ስምንት",
"አስራ ዘጠኝ",
"ሃያ",
... | 1,573 | 14.281553 | 49 | py |
spaCy | spaCy-master/spacy/lang/am/punctuation.py | from ..char_classes import (
ALPHA_UPPER,
CURRENCY,
LIST_ELLIPSES,
LIST_PUNCT,
LIST_QUOTES,
UNITS,
)
_list_punct = LIST_PUNCT + "፡ ። ፣ ፤ ፥ ፦ ፧ ፠ ፨".strip().split()
_suffixes = (
_list_punct
+ LIST_ELLIPSES
+ LIST_QUOTES
+ [
r"(?<=[0-9])\+",
# Amharic is written ... | 529 | 19.384615 | 62 | py |
spaCy | spaCy-master/spacy/lang/am/stop_words.py | # Stop words by Teshome Kassie http://etd.aau.edu.et/bitstream/handle/123456789/3315/Teshome%20Kassie.pdf?sequence=1&isAllowed=y
# Stop words by Tihitina Petros http://etd.aau.edu.et/bitstream/handle/123456789/3384/Tihitina%20Petros.pdf?sequence=1&isAllowed=y
STOP_WORDS = set(
"""
ግን አንቺ አንተ እናንተ ያንተ ያንቺ የናንተ ራስህን... | 1,424 | 40.911765 | 130 | py |
spaCy | spaCy-master/spacy/lang/am/tokenizer_exceptions.py | from ...symbols import NORM, ORTH
_exc = {}
for exc_data in [
{ORTH: "ት/ቤት"},
{ORTH: "ወ/ሮ", NORM: "ወይዘሮ"},
]:
_exc[exc_data[ORTH]] = [exc_data]
for orth in [
"ዓ.ም.",
"ኪ.ሜ.",
]:
_exc[orth] = [{ORTH: orth}]
TOKENIZER_EXCEPTIONS = _exc
| 264 | 11.619048 | 37 | py |
spaCy | spaCy-master/spacy/lang/ar/__init__.py | from ...language import BaseDefaults, Language
from .lex_attrs import LEX_ATTRS
from .punctuation import TOKENIZER_SUFFIXES
from .stop_words import STOP_WORDS
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
class ArabicDefaults(BaseDefaults):
tokenizer_exceptions = TOKENIZER_EXCEPTIONS
suffixes = TOKEN... | 572 | 25.045455 | 81 | py |