Comments (7)
Depends on the usecase and language.
However, you can also download my package fast-sentence-transformers
and use it in combination with classy-classification. I will release this implementation later.
from classy_classification import classyClassifier
from fast_sentence_transformers import FastSentenceTransformer as SentenceTransformer
__all__ = ["SentenceTransformer"]
class FastClassyClassifier(classyClassifier):
def __init__(self, embedding_model, *args, **kwargs):
self.embedding_model = embedding_model
super().__init__(*args, **kwargs)
def set_embedding_model(self, model: str = None, device: str = "cpu"):
self.model = model
self.device = device
pass
from classy-classification.
This should result in a x5 speedup on CPU.
from classy-classification.
@davidberenstein1957 appreciate your response.
from classy-classification.
@nsankar note that you should initialize the classifier with the fast_sentence_transformer embedding model.
from classy-classification.
Also, you can find a model overview here. https://www.sbert.net/docs/pretrained_models.html
from classy-classification.
Ok. Thanks
from classy-classification.
@nsankar I added the speed feature.
from classy-classification.
Related Issues (20)
- ImportError: cannot import name 'cached_path' from 'transformers.file_utils' (/opt/conda/lib/python3.7/site-packages/transformers/file_utils.py) HOT 3
- Saving and loading models
- retrain on saved pickle model? HOT 2
- add zero-shot `onnx`support
- Misaligned pairings of labels and scores? HOT 8
- add `https://onnx.ai/sklearn-onnx/` support HOT 1
- add saving and loading support for `standalone` reproducability HOT 3
- between zero shot and few shot HOT 1
- setfit in classy classification HOT 7
- Drastic performance drop HOT 5
- Running the first example we get a different score HOT 2
- Error when using spacy _trf models HOT 6
- Different language models HOT 9
- Standalone usage without spaCy setting embeddings post adding the data makes the classifications run twice HOT 1
- Token indices sequence length HOT 1
- Spacy embeddings vs sentence transformer embeddings HOT 1
- Example code gives error
- Would be great to also apply the classifier on arbitrary Spans HOT 2
- The current version of package is unstable and exceptions occur HOT 2
- Installations on Ubuntu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from classy-classification.