--- license: apache-2.0 tags: - text-classification - generic - notebook-favorites library_name: generic --- ## Hugging Face Transformers with Scikit-learn Classifiers 🤩🌟 This repository contains a small proof-of-concept pipeline that leverages longformer embeddings with scikit-learn Logistic Regression that does sentiment analysis. The training leverages the language module of [whatlies](https://github.com/koaning/whatlies). See the tutorial notebook [here](https://www.kaggle.com/code/unofficialmerve/scikit-learn-with-transformers/notebook). # Classification Report 📈 Below is the classification report 👇🏻 ``` precision recall f1-score support 0 0.85 0.89 0.87 522 1 0.89 0.85 0.87 550 accuracy 0.87 1072 macro avg 0.87 0.87 0.87 1072 weighted avg 0.87 0.87 0.87 1072 ``` # Pipeline 🌟 Below you can see the pipeline 👇🏻 (it's interactive! 🪄)
Pipeline(steps=[('embedding',\n HFTransformersLanguage(model_name_or_path='facebook/bart-base')),\n ('model', LogisticRegression())])Please rerun this cell to show the HTML repr or trust the notebook.
Pipeline(steps=[('embedding',\n HFTransformersLanguage(model_name_or_path='facebook/bart-base')),\n ('model', LogisticRegression())])
HFTransformersLanguage(model_name_or_path='facebook/bart-base')
LogisticRegression()