Requirement already satisfied: tweepy in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (4.14.0)
Requirement already satisfied: emoji in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (2.13.2)
Requirement already satisfied: nltk in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (3.9.1)
Requirement already satisfied: textblob in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (0.18.0.post0)
Requirement already satisfied: wordcloud in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (1.9.3)
Requirement already satisfied: seaborn in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (0.13.0)
Requirement already satisfied: scikit-learn in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (1.5.2)
Requirement already satisfied: imblearn in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (0.0)
Requirement already satisfied: transformers in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (4.45.1)
Requirement already satisfied: gensim in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (4.3.3)
Requirement already satisfied: shap in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (0.46.0)
Requirement already satisfied: oauthlib<4,>=3.2.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from tweepy) (3.2.2)
Requirement already satisfied: requests<3,>=2.27.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from tweepy) (2.32.3)
Requirement already satisfied: requests-oauthlib<2,>=1.2.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from tweepy) (1.3.1)
Requirement already satisfied: click in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from nltk) (8.1.3)
Requirement already satisfied: joblib in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from nltk) (1.4.2)
Requirement already satisfied: regex>=2021.8.3 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from nltk) (2024.9.11)
Requirement already satisfied: tqdm in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from nltk) (4.64.1)
Requirement already satisfied: numpy>=1.6.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from wordcloud) (1.26.4)
Requirement already satisfied: pillow in c:\users\navne_idok\appdata\roaming\python\python310\site-packages (from wordcloud) (10.1.0)
Requirement already satisfied: matplotlib in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from wordcloud) (3.9.2)
Requirement already satisfied: pandas>=1.2 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from seaborn) (1.4.3)
Requirement already satisfied: scipy>=1.6.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from scikit-learn) (1.13.1)
Requirement already satisfied: threadpoolctl>=3.1.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from scikit-learn) (3.5.0)
Requirement already satisfied: imbalanced-learn in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from imblearn) (0.12.3)
Requirement already satisfied: filelock in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (3.16.1)
Requirement already satisfied: huggingface-hub<1.0,>=0.23.2 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (0.25.1)
Requirement already satisfied: packaging>=20.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (23.0)
Requirement already satisfied: pyyaml>=5.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (6.0)
Requirement already satisfied: safetensors>=0.4.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (0.4.5)
Requirement already satisfied: tokenizers<0.21,>=0.20 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from transformers) (0.20.0)
Requirement already satisfied: smart-open>=1.8.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from gensim) (7.0.4)
Requirement already satisfied: slicer==0.0.8 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from shap) (0.0.8)
Requirement already satisfied: numba in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from shap) (0.60.0)
Requirement already satisfied: cloudpickle in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from shap) (3.0.0)
Requirement already satisfied: fsspec>=2023.5.0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (2024.9.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub<1.0,>=0.23.2->transformers) (4.12.2)
Requirement already satisfied: contourpy>=1.0.1 in c:\users\navne_idok\appdata\roaming\python\python310\site-packages (from matplotlib->wordcloud) (1.2.0)
Requirement already satisfied: cycler>=0.10 in c:\users\navne_idok\appdata\roaming\python\python310\site-packages (from matplotlib->wordcloud) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\navne_idok\appdata\roaming\python\python310\site-packages (from matplotlib->wordcloud) (4.47.0)
Requirement already satisfied: kiwisolver>=1.3.1 in c:\users\navne_idok\appdata\roaming\python\python310\site-packages (from matplotlib->wordcloud) (1.4.5)
Requirement already satisfied: pyparsing>=2.3.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from matplotlib->wordcloud) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from matplotlib->wordcloud) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from pandas>=1.2->seaborn) (2022.1)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from requests<3,>=2.27.0->tweepy) (3.0.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from requests<3,>=2.27.0->tweepy) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from requests<3,>=2.27.0->tweepy) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from requests<3,>=2.27.0->tweepy) (2022.12.7)
Requirement already satisfied: wrapt in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from smart-open>=1.8.1->gensim) (1.16.0)
Requirement already satisfied: colorama in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from tqdm->nltk) (0.4.5)
Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from numba->shap) (0.43.0)
Requirement already satisfied: six>=1.5 in c:\users\navne_idok\appdata\local\programs\python\python310\lib\site-packages (from python-dateutil>=2.7->matplotlib->wordcloud) (1.16.0)
['Solarize_Light2', '_classic_test_patch', '_mpl-gallery', '_mpl-gallery-nogrid', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-v0_8', 'seaborn-v0_8-bright', 'seaborn-v0_8-colorblind', 'seaborn-v0_8-dark', 'seaborn-v0_8-dark-palette', 'seaborn-v0_8-darkgrid', 'seaborn-v0_8-deep', 'seaborn-v0_8-muted', 'seaborn-v0_8-notebook', 'seaborn-v0_8-paper', 'seaborn-v0_8-pastel', 'seaborn-v0_8-poster', 'seaborn-v0_8-talk', 'seaborn-v0_8-ticks', 'seaborn-v0_8-white', 'seaborn-v0_8-whitegrid', 'tableau-colorblind10']
[nltk_data] Downloading package stopwords to
[nltk_data]     C:\Users\navne_idok\AppData\Roaming\nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
[nltk_data] Downloading package wordnet to
[nltk_data]     C:\Users\navne_idok\AppData\Roaming\nltk_data...
[nltk_data]   Package wordnet is already up-to-date!
[nltk_data] Downloading package omw-1.4 to
[nltk_data]     C:\Users\navne_idok\AppData\Roaming\nltk_data...
[nltk_data]   Package omw-1.4 is already up-to-date!
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\style\core.py:137, in use(style)
    136 try:
--> 137     style = _rc_params_in_file(style)
    138 except OSError as err:

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\__init__.py:870, in _rc_params_in_file(fname, transform, fail_on_error)
    869 rc_temp = {}
--> 870 with _open_file_or_url(fname) as fd:
    871     try:

File ~\AppData\Local\Programs\Python\Python310\lib\contextlib.py:135, in _GeneratorContextManager.__enter__(self)
    134 try:
--> 135     return next(self.gen)
    136 except StopIteration:

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\__init__.py:847, in _open_file_or_url(fname)
    846 fname = os.path.expanduser(fname)
--> 847 with open(fname, encoding='utf-8') as f:
    848     yield f

FileNotFoundError: [Errno 2] No such file or directory: 'seaborn'

The above exception was the direct cause of the following exception:

OSError                                   Traceback (most recent call last)
Cell In[5], line 56
     53 get_ipython().run_line_magic('matplotlib', 'inline')
     54 print(plt.style.available)
---> 56 plt.style.use('seaborn')

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\style\core.py:139, in use(style)
    137         style = _rc_params_in_file(style)
    138     except OSError as err:
--> 139         raise OSError(
    140             f"{style!r} is not a valid package style, path of style "
    141             f"file, URL of style file, or library style name (library "
    142             f"styles are listed in `style.available`)") from err
    143 filtered = {}
    144 for k in style:  # don't trigger RcParams.__getitem__('backend')

OSError: 'seaborn' is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in `style.available`)


code:
# Install necessary libraries
!pip install tweepy emoji nltk textblob wordcloud seaborn scikit-learn imblearn transformers gensim shap seaborn

# Import Libraries
import pandas as pd
import numpy as np
import re
import emoji
import string
import contractions
from textblob import TextBlob
from wordcloud import WordCloud
import matplotlib.pyplot as plt
import seaborn as sns
import nltk
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFold, cross_val_score
from sklearn.metrics import (accuracy_score, precision_score, recall_score, f1_score,
                             classification_report, confusion_matrix, roc_auc_score,
                             roc_curve, precision_recall_curve, average_precision_score)
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, VotingClassifier
from sklearn.naive_bayes import MultinomialNB
from imblearn.over_sampling import SMOTE
from transformers import BertTokenizer, TFBertForSequenceClassification
import tensorflow as tf
from gensim.models import Word2Vec
import shap
import warnings
import joblib
import random
import os

# Suppress warnings
warnings.filterwarnings('ignore')

# Download NLTK data
nltk.download('stopwords')
nltk.download('wordnet')
nltk.download('omw-1.4')

# Set random seed for reproducibility
SEED = 42
random.seed(SEED)
np.random.seed(SEED)
tf.random.set_seed(SEED)

# Configure matplotlib
%matplotlib inline
print(plt.style.available)

plt.style.use('seaborn')