Domain Matcher
Domain Matcher is a library that aims at matching a pre-defined domain to your input data. Input without domain are deemed not important and thus can be safely filtered out.
Domain Matching performs very cheap OoD detection using topic modeling and keyword extraction.
pip install domain-matcher
Usage
from datasets import load_dataset
from domain_matcher.core import DomainMatcher, DMConfig
# Custom version of `clinc-oos` where non-banking classes are assigned to oos.
ds = load_dataset("GlowstickAI/banking-clinc-oos", "plus")
config = DMConfig(text_column='text', label_column='intent', oos_class='oos')
dmatcher = DomainMatcher(config)
# Fit DM on your train data see our blog to see what's happening!
dmatcher.fit(ds['train'])
# Predict: You can predict on a string, List[str] or Dataset
dmatcher.transform("Can you cancel my credit card?")['in_domain']
# >>> True
dmatcher.transform("Can you cancel my reservation at Giorgi's?")['in_domain']
# >>> False
Troubleshooting
For troubleshooting, please see our wiki or submit an issue if you can't find what you're looking for.
Development
- Install Pyenv
curl https://pyenv.run | bashpyenv install 3.9.13 && pyenv global 3.9.13
- Install Poetry
poetry install- Add precommits
poetry run pre-commit install
Tooling
make format: format the code with Ruffmake test: run unit tests and mypy.
Metadata
Release files for domain-matcher 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| domain_matcher-0.1.0.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| domain_matcher-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.4 kB
Release files / domain_matcher-0.1.0.tar.gz
| Download URL | domain_matcher-0.1.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d69b3ad6a9509fdfa39306b62c52f3e3be4a23859bd3bc69c738f570b449e603
|
|
BLAKE2b-256 checksum How to use checksums |
c9c0dd60a6b0b8d68bcfa00c60542ce54c4b67122c0bffd997c6bc836b233c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.13 Linux/6.2.6-76060206-generic
|
Release files / domain_matcher-0.1.0-py3-none-any.whl
| Download URL | domain_matcher-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32f5de070477ee750d30b5279a6fc7605e8ec10336147a210d85ba47d78492fe
|
|
BLAKE2b-256 checksum How to use checksums |
7dfc87e26de639e18f22dba3a0a8c6f88e1df967de0b1f0ece512ef03e1e8d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.9.13 Linux/6.2.6-76060206-generic
|