In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 52
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Check Accuracy on the test set\n",
+ "accuracy = pipe_lr.score(x_test_preprocessed.flatten(), y_test)\n",
+ "print(\"Accuracy on test set:\", accuracy)\n"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "e_ARp89ildUp",
+ "outputId": "2adb1a44-5c0a-41f4-e999-8a3c02db2943"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Accuracy on test set: 0.622341444721211\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Make A Prediction\n",
+ "ex1 = \"This book was so interesting it made me happy\""
+ ],
+ "metadata": {
+ "id": "85W8OW2UmCF8"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "pipe_lr.predict([ex1])\n"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "fc7JI4H9mDTv",
+ "outputId": "20d22a7c-4dc5-4519-da4e-773a3d3b8d53"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "array(['joy'], dtype=object)"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 58
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Prediction Prob\n",
+ "pipe_lr.predict_proba([ex1])"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "VSOSjNrOmHAK",
+ "outputId": "83106b53-8ecb-476a-bc83-6009061032a8"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "array([[1.55722408e-03, 6.83959715e-03, 1.18109693e-02, 9.50298403e-01,\n",
+ " 9.97433637e-06, 2.21851774e-02, 5.01819368e-05, 7.24847268e-03]])"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 59
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# To Know the classes\n",
+ "pipe_lr.classes_"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Pr8yTw_pmJND",
+ "outputId": "69601abb-a8dd-4130-8ccd-8fc9d07024b8"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "array(['anger', 'disgust', 'fear', 'joy', 'neutral', 'sadness', 'shame',\n",
+ " 'surprise'], dtype=object)"
+ ]
+ },
+ "metadata": {},
+ "execution_count": 60
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Save Model & Pipeline\n",
+ "import joblib\n",
+ "pipeline_file = open(\"emotion_classifier_pipe_lr_03_june_2021.pkl\",\"wb\")\n",
+ "joblib.dump(pipe_lr,pipeline_file)\n",
+ "pipeline_file.close()"
+ ],
+ "metadata": {
+ "id": "SgSlzyKgmKHR"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "! pip install streamlit -q"
+ ],
+ "metadata": {
+ "id": "uEnBaTdfX4Sl"
+ },
+ "execution_count": 8,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!wget -q -O - ipv4.icanhazip.com"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "-vvI0mt-YI3t",
+ "outputId": "a46d8972-4716-4a69-a590-0288a3e4cefb"
+ },
+ "execution_count": 9,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "34.86.172.203\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "pip install streamlit pandas numpy joblib altair plotly\n"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Xga3z9SqZeUm",
+ "outputId": "783a7589-9a87-48fc-9e28-f7f4a4ec2fdf"
+ },
+ "execution_count": 10,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: streamlit in /usr/local/lib/python3.10/dist-packages (1.29.0)\n",
+ "Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (1.5.3)\n",
+ "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (1.23.5)\n",
+ "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (1.3.2)\n",
+ "Requirement already satisfied: altair in /usr/local/lib/python3.10/dist-packages (4.2.2)\n",
+ "Requirement already satisfied: plotly in /usr/local/lib/python3.10/dist-packages (5.15.0)\n",
+ "Requirement already satisfied: blinker<2,>=1.0.0 in /usr/lib/python3/dist-packages (from streamlit) (1.4)\n",
+ "Requirement already satisfied: cachetools<6,>=4.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (5.3.2)\n",
+ "Requirement already satisfied: click<9,>=7.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (8.1.7)\n",
+ "Requirement already satisfied: importlib-metadata<7,>=1.4 in /usr/local/lib/python3.10/dist-packages (from streamlit) (6.8.0)\n",
+ "Requirement already satisfied: packaging<24,>=16.8 in /usr/local/lib/python3.10/dist-packages (from streamlit) (23.2)\n",
+ "Requirement already satisfied: pillow<11,>=7.1.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (9.4.0)\n",
+ "Requirement already satisfied: protobuf<5,>=3.20 in /usr/local/lib/python3.10/dist-packages (from streamlit) (3.20.3)\n",
+ "Requirement already satisfied: pyarrow>=6.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (9.0.0)\n",
+ "Requirement already satisfied: python-dateutil<3,>=2.7.3 in /usr/local/lib/python3.10/dist-packages (from streamlit) (2.8.2)\n",
+ "Requirement already satisfied: requests<3,>=2.27 in /usr/local/lib/python3.10/dist-packages (from streamlit) (2.31.0)\n",
+ "Requirement already satisfied: rich<14,>=10.14.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (13.7.0)\n",
+ "Requirement already satisfied: tenacity<9,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (8.2.3)\n",
+ "Requirement already satisfied: toml<2,>=0.10.1 in /usr/local/lib/python3.10/dist-packages (from streamlit) (0.10.2)\n",
+ "Requirement already satisfied: typing-extensions<5,>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (4.5.0)\n",
+ "Requirement already satisfied: tzlocal<6,>=1.1 in /usr/local/lib/python3.10/dist-packages (from streamlit) (5.2)\n",
+ "Requirement already satisfied: validators<1,>=0.2 in /usr/local/lib/python3.10/dist-packages (from streamlit) (0.22.0)\n",
+ "Requirement already satisfied: gitpython!=3.1.19,<4,>=3.0.7 in /usr/local/lib/python3.10/dist-packages (from streamlit) (3.1.40)\n",
+ "Requirement already satisfied: pydeck<1,>=0.8.0b4 in /usr/local/lib/python3.10/dist-packages (from streamlit) (0.8.1b0)\n",
+ "Requirement already satisfied: tornado<7,>=6.0.3 in /usr/local/lib/python3.10/dist-packages (from streamlit) (6.3.2)\n",
+ "Requirement already satisfied: watchdog>=2.1.5 in /usr/local/lib/python3.10/dist-packages (from streamlit) (3.0.0)\n",
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas) (2023.3.post1)\n",
+ "Requirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from altair) (0.4)\n",
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from altair) (3.1.2)\n",
+ "Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/dist-packages (from altair) (4.19.2)\n",
+ "Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from altair) (0.12.0)\n",
+ "Requirement already satisfied: gitdb<5,>=4.0.1 in /usr/local/lib/python3.10/dist-packages (from gitpython!=3.1.19,<4,>=3.0.7->streamlit) (4.0.11)\n",
+ "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata<7,>=1.4->streamlit) (3.17.0)\n",
+ "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair) (23.1.0)\n",
+ "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair) (2023.11.1)\n",
+ "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair) (0.31.1)\n",
+ "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair) (0.13.2)\n",
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->altair) (2.1.3)\n",
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil<3,>=2.7.3->streamlit) (1.16.0)\n",
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (3.3.2)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (3.6)\n",
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (2.0.7)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (2023.11.17)\n",
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich<14,>=10.14.0->streamlit) (3.0.0)\n",
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich<14,>=10.14.0->streamlit) (2.16.1)\n",
+ "Requirement already satisfied: smmap<6,>=3.0.1 in /usr/local/lib/python3.10/dist-packages (from gitdb<5,>=4.0.1->gitpython!=3.1.19,<4,>=3.0.7->streamlit) (5.0.1)\n",
+ "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich<14,>=10.14.0->streamlit) (0.1.2)\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "! streamlit run app.py & npx localtunnel --port 8501"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "3o1VKylNZrn-",
+ "outputId": "4187329f-5810-4594-839c-d2b1fe99c25c"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "[..................] \\ fetchMetadata: sill resolveWithNewModule localtunnel@2.0\u001b[0m\u001b[K\n",
+ "Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.\n",
+ "\u001b[0m\n",
+ "\u001b[0m\n",
+ "\u001b[34m\u001b[1m You can now view your Streamlit app in your browser.\u001b[0m\n",
+ "\u001b[0m\n",
+ "\u001b[34m Network URL: \u001b[0m\u001b[1mhttp://172.28.0.12:8501\u001b[0m\n",
+ "\u001b[34m External URL: \u001b[0m\u001b[1mhttp://34.86.172.203:8501\u001b[0m\n",
+ "\u001b[0m\n",
+ "\u001b[K\u001b[?25hnpx: installed 22 in 2.594s\n",
+ "your url is: https://cruel-jobs-drop.loca.lt\n",
+ "2023-12-02 12:13:28.586 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 43, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:15:00.878 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 43, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:15:32.342 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 43, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:15:32.869 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 43, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:21:23.278 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 111, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 50, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:21:51.082 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 109, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 48, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:22:02.981 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 108, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 47, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:22:43.925 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 43, in main\n",
+ " prediction = predict_emotions(raw_text)\n",
+ " File \"/content/app.py\", line 14, in predict_emotions\n",
+ " results = pipe_lr.predict([docx])\n",
+ "NameError: name 'pipe_lr' is not defined\n",
+ "2023-12-02 12:22:47.880 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 76, in main\n",
+ " with st.beta_expander(\"Page Metrics\"):\n",
+ "AttributeError: module 'streamlit' has no attribute 'beta_expander'\n",
+ "2023-12-02 12:23:55.122 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 11, in \n",
+ " pipe_lr = joblib.load('model.pkl')\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/joblib/numpy_pickle.py\", line 650, in load\n",
+ " with open(filename, 'rb') as f:\n",
+ "FileNotFoundError: [Errno 2] No such file or directory: 'model.pkl'\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:24:41.439 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 67, in main\n",
+ " fig = alt.Chart(proba_df_clean).mark_bar().encode(x='emotions',y='probability',color='emotions')\n",
+ "NameError: name 'alt' is not defined\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:25:06.387 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 76, in main\n",
+ " with st.beta_expander(\"Page Metrics\"):\n",
+ "AttributeError: module 'streamlit' has no attribute 'beta_expander'\n",
+ "2023-12-02 12:25:22.638 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 67, in main\n",
+ " fig = alt.Chart(proba_df_clean).mark_bar().encode(x='emotions',y='probability',color='emotions')\n",
+ "NameError: name 'alt' is not defined\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:25:58.550 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 67, in main\n",
+ " fig = alt.Chart(proba_df_clean).mark_bar().encode(x='emotions',y='probability',color='emotions')\n",
+ "NameError: name 'alt' is not defined\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:26:45.560 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 76, in main\n",
+ " with st.beta_expander(\"Page Metrics\"):\n",
+ "AttributeError: module 'streamlit' has no attribute 'beta_expander'\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:27:27.982 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 76, in main\n",
+ " with st.beta_expander(\"Page Metrics\"):\n",
+ "AttributeError: module 'streamlit' has no attribute 'beta_expander'\n",
+ "2023-12-02 12:28:18.211 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 104, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 84, in main\n",
+ " p = px.pie(pg_count,values='Counts',names='Pagename')\n",
+ "NameError: name 'px' is not defined\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ " warnings.warn(\n",
+ "2023-12-02 12:29:12.525 Uncaught app exception\n",
+ "Traceback (most recent call last):\n",
+ " File \"/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py\", line 534, in _run_script\n",
+ " exec(code, module.__dict__)\n",
+ " File \"/content/app.py\", line 105, in \n",
+ " main()\n",
+ " File \"/content/app.py\", line 88, in main\n",
+ " with st.beta_expander('Emotion Classifier Metrics'):\n",
+ "AttributeError: module 'streamlit' has no attribute 'beta_expander'\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "2023-12-02 12:29:42.912 Serialization of dataframe to Arrow table was unsuccessful due to: (\"Expected bytes, got a 'float' object\", 'Conversion failed for column Probability with type object'). Applying automatic fixes for column types to make the dataframe Arrow-compatible.\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "2023-12-02 12:29:50.269 Serialization of dataframe to Arrow table was unsuccessful due to: (\"Expected bytes, got a 'float' object\", 'Conversion failed for column Probability with type object'). Applying automatic fixes for column types to make the dataframe Arrow-compatible.\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "2023-12-02 12:31:48.227 Serialization of dataframe to Arrow table was unsuccessful due to: (\"Expected bytes, got a 'float' object\", 'Conversion failed for column Probability with type object'). Applying automatic fixes for column types to make the dataframe Arrow-compatible.\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator CountVectorizer from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator LogisticRegression from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n",
+ "/usr/local/lib/python3.10/dist-packages/sklearn/base.py:318: UserWarning:\n",
+ "\n",
+ "Trying to unpickle estimator Pipeline from version 0.24.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:\n",
+ "https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations\n",
+ "\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "nktwF-T-ZrY4",
+ "outputId": "a1b8b24f-4bd7-4e21-aa72-7dd30db46864"
+ },
+ "execution_count": 13,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "\u001b[31mERROR: Could not find a version that satisfies the requirement track_utils (from versions: none)\u001b[0m\u001b[31m\n",
+ "\u001b[0m\u001b[31mERROR: No matching distribution found for track_utils\u001b[0m\u001b[31m\n",
+ "\u001b[0m"
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file