Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: Tecorigin
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 11.5 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created 7 months ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

Thinc: A refreshing functional take on deep learning, compatible with your favorite libraries

From the makers of spaCy and Prodigy

Thinc is a lightweight deep learning library that offers an elegant, type-checked, functional-programming API for composing models, with support for layers defined in other frameworks such as PyTorch, TensorFlow and MXNet. You can use Thinc as an interface layer, a standalone toolkit or a flexible way to develop new models. Previous versions of Thinc have been running quietly in production in thousands of companies, via both spaCy and Prodigy. We wrote the new version to let users compose, configure and deploy custom models built with their favorite framework.

tests Current Release Version PyPi Version conda Version Python wheels Code style: black Open demo in Colab

🔥 Features

  • Type-check your model definitions with custom types and mypy plugin.
  • Wrap PyTorch, TensorFlow and MXNet models for use in your network.
  • Concise functional-programming approach to model definition, using composition rather than inheritance.
  • Optional custom infix notation via operator overloading.
  • Integrated config system to describe trees of objects and hyperparameters.
  • Choice of extensible backends.
  • Read more →

🚀 Quickstart

Thinc is compatible with Python 3.6+ and runs on Linux, macOS and Windows. The latest releases with binary wheels are available from pip. Before you install Thinc and its dependencies, make sure that your pip, setuptools and wheel are up to date. For the most recent releases, pip 19.3 or newer is recommended.

bash pip install thinc-9.1.1-cp310-cp310-linux_x86_64.whl

See the extended installation docs for details on optional dependencies for different backends and GPU. You might also want to set up static type checking to take advantage of Thinc's type system.

⚠️ If you have installed PyTorch and you are using Python 3.7+, uninstall the package dataclasses with pip uninstall dataclasses, since it may have been installed by PyTorch and is incompatible with Python 3.7+.

📓 Selected examples and notebooks

Also see the /examples directory and usage documentation for more examples. Most examples are Jupyter notebooks – to launch them on Google Colab (with GPU support!) click on the button next to the notebook name.

| Notebook | Description | | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | intro_to_thinc
Open in Colab | Everything you need to know to get started. Composing and training a model on the MNIST data, using config files, registering custom functions and wrapping PyTorch, TensorFlow and MXNet models. | | transformers_tagger_bert
Open in Colab | How to use Thinc, transformers and PyTorch to train a part-of-speech tagger. From model definition and config to the training loop. | | pos_tagger_basic_cnn
Open in Colab | Implementing and training a basic CNN for part-of-speech tagging model without external dependencies and using different levels of Thinc's config system. | | parallel_training_ray
Open in Colab | How to set up synchronous and asynchronous parameter server training with Thinc and Ray. |

View more →

📖 Documentation & usage guides

| Documentation | Description | | --------------------------------------------------------------------------------- | ----------------------------------------------------- | | Introduction | Everything you need to know. | | Concept & Design | Thinc's conceptual model and how it works. | | Defining and using models | How to compose models and update state. | | Configuration system | Thinc's config system and function registry. | | Integrating PyTorch, TensorFlow & MXNet | Interoperability with machine learning frameworks | | Layers API | Weights layers, transforms, combinators and wrappers. | | Type Checking | Type-check your model definitions and more. |

🗺 What's where

| Module | Description | | ----------------------------------------- | --------------------------------------------------------------------------------- | | thinc.api | User-facing API. All classes and functions should be imported from here. | | thinc.types | Custom types and dataclasses. | | thinc.model | The Model class. All Thinc models are an instance (not a subclass) of Model. | | thinc.layers | The layers. Each layer is implemented in its own module. | | thinc.shims | Interface for external models implemented in PyTorch, TensorFlow etc. | | thinc.loss | Functions to calculate losses. | | thinc.optimizers | Functions to create optimizers. Currently supports "vanilla" SGD, Adam and RAdam. | | thinc.schedules | Generators for different rates, schedules, decays or series. | | thinc.backends | Backends for numpy and cupy. | | thinc.config | Config parsing and validation and function registry system. | | thinc.util | Utilities and helper functions. |

🐍 Development notes

Thinc uses black for auto-formatting, flake8 for linting and mypy for type checking. All code is written compatible with Python 3.6+, with type hints wherever possible. See the type reference for more details on Thinc's custom types.

👷‍♀️ Building Thinc from source

Building Thinc from source requires the full dependencies listed in requirements.txt to be installed. You'll also need a compiler to build the C extensions.

bash git clone https://github.com/explosion/thinc cd thinc python -m venv .env source .env/bin/activate pip install -U pip setuptools wheel pip install -r requirements.txt pip install --no-build-isolation .

Alternatively, install in editable mode:

bash pip install -r requirements.txt pip install --no-build-isolation --editable .

Or by setting PYTHONPATH:

bash export PYTHONPATH=`pwd` pip install -r requirements.txt python setup.py build_ext --inplace

🚦 Running tests

Thinc comes with an extensive test suite. The following should all pass and not report any warnings or errors:

bash python -m pytest thinc # test suite python -m mypy thinc # type checks python -m flake8 thinc # linting

To view test coverage, you can run python -m pytest thinc --cov=thinc. We aim for a 100% test coverage. This doesn't mean that we meticulously write tests for every single line – we ignore blocks that are not relevant or difficult to test and make sure that the tests execute all code paths.

Owner

  • Login: Tecorigin
  • Kind: user

Where There is Computation, There is Tecorigin.

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use Thinc in research, please use this as a citation.
title: Thinc
abstract: "🔮 A refreshing functional take on deep learning, compatible with your favorite libraries"
authors:
  - family-names: "Honnibal"
    given-names: "Matthew"
  - family-names: "Montani"
    given-names: "Ines"
  - family-names: "Van Landeghem"
    given-names: "Sofie"
  - family-names: "Boyd"
    given-names: "Adriane"
  - family-names: "DuJardin"
    given-names: "Justin"
version: 8.0.0
date-released: "2021-01-21"
license: MIT
repository-code: "https://github.com/explosion/thinc"

GitHub Events

Total
  • Push event: 4
  • Create event: 18
Last Year
  • Push event: 4
  • Create event: 18

Dependencies

.github/workflows/cibuildwheel.yml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
  • pypa/cibuildwheel v2.19.1 composite
  • softprops/action-gh-release v2 composite
.github/workflows/explosionbot.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/issue-manager.yml actions
  • tiangolo/issue-manager 0.4.0 composite
.github/workflows/publish_pypi.yml actions
  • pypa/gh-action-pypi-publish release/v1 composite
  • robinraju/release-downloader v1 composite
.github/workflows/tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
website/meta.json cpan
website/Dockerfile docker
  • node 16 build
website/package-lock.json npm
  • 1723 dependencies
website/package.json npm
  • babel-cli ^6.26.0 development
  • babel-core ^6.26.0 development
  • babel-plugin-transform-class-properties ^6.24.1 development
  • babel-plugin-transform-decorators-legacy ^1.3.4 development
  • babel-plugin-transform-object-rest-spread ^6.26.0 development
  • babel-plugin-transform-react-remove-prop-types ^0.4.13 development
  • babel-preset-env ^1.6.1 development
  • babel-preset-react ^6.24.1 development
  • json5 ^2.1.0 development
  • md-attr-parser ^1.2.1 development
  • prettier ^1.16.4 development
  • unist-util-remove ^1.0.3 development
  • unist-util-visit ^1.4.0 development
  • @tippy.js/react ^2.2.2
  • autoprefixer ^10.4.13
  • classnames ^2.2.6
  • gatsby ^4.18.2
  • gatsby-image ^2.11.0
  • gatsby-plugin-google-analytics ^4.25.0
  • gatsby-plugin-manifest ^4.25.0
  • gatsby-plugin-offline ^5.25.0
  • gatsby-plugin-plausible ^0.0.7
  • gatsby-plugin-react-helmet ^5.25.0
  • gatsby-plugin-react-svg ^3.3.0
  • gatsby-plugin-remove-trailing-slashes ^4.19.0
  • gatsby-plugin-sass ^5.25.0
  • gatsby-plugin-sass-resources ^3.0.1
  • gatsby-plugin-sharp ^4.25.0
  • gatsby-plugin-sitemap ^5.25.0
  • gatsby-remark-copy-linked-files ^5.25.0
  • gatsby-remark-images ^6.25.0
  • gatsby-remark-prismjs ^6.25.0
  • gatsby-remark-smartypants ^5.25.0
  • gatsby-remark-unwrap-images ^1.0.2
  • gatsby-source-filesystem ^4.25.0
  • gatsby-transformer-remark ^5.25.1
  • gatsby-transformer-sharp ^4.25.0
  • html-to-react ^1.3.4
  • parse-numeric-range 0.0.2
  • prismjs ^1.15.0
  • react ^16.8.2
  • react-dom ^16.8.2
  • react-helmet ^5.2.0
  • react-jss ^8.6.1
  • rehype-react ^3.1.0
  • remark-react ^5.0.1
  • slugify ^1.3.6
website/plugins/gatsby-remark-code-blocks/package.json npm
website/plugins/gatsby-remark-custom-attrs/package.json npm
website/plugins/gatsby-remark-unwrap/package.json npm
pyproject.toml pypi
requirements.txt pypi
  • black >=22.0,<23.0
  • blis >=1.0.0,<1.1.0
  • catalogue >=2.0.4,<2.1.0
  • confection >=0.0.1,<1.0.0
  • coverage >=5.0.0,<8.0.0
  • cymem >=2.0.2,<2.1.0
  • cython >=0.25.0,<3.0
  • flake8 >=3.5.0,<3.6.0
  • hypothesis >=3.27.0,<6.72.2
  • ipykernel >=5.1.4,<5.2.0
  • isort >=5.0,<6.0
  • ml_datasets >=0.2.0,<0.3.0
  • mock >=2.0.0,<3.0.0
  • murmurhash >=1.0.2,<1.1.0
  • mypy >=1.5.0,<1.6.0
  • nbconvert >=5.6.1,<6.2.0
  • nbformat >=5.0.4,<5.2.0
  • numpy ==1.26.0
  • packaging >=20.0
  • pathy >=0.3.5
  • preshed >=3.0.2,<3.1.0
  • pydantic >=1.7.4,
  • pytest >=8.2.0
  • pytest-cov >=2.7.0,<5.0.0
  • srsly >=2.4.0,<3.0.0
  • types-mock >=0.1.1
  • wasabi >=0.8.1,<1.2.0
setup.py pypi