readme: ---
  license: apache-2.0
  tags:
  - text-classification
  - generic
  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! 🪄)
  <style>#sk-40148507-8fa3-419e-8462-0cd31028ba20 {color: black;background-color: white;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 pre{padding: 0;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-toggleable {background-color: white;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-estimator:hover {background-color: #d4ebff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-item {z-index: 1;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 2em;bottom: 0;left: 50%;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel-item {display: flex;flex-direction: column;position: relative;background-color: white;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-parallel-item:only-child::after {width: 0;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;position: relative;}#sk-40148507-8fa3-419e-8462-0cd31028ba20 div.sk-label label {font-family: monospace;font-weight: bold;background-color: white;display: inline-block;line