{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "dc83b044", "metadata": { "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", "execution": { "iopub.execute_input": "2025-07-31T07:30:53.259401Z", "iopub.status.busy": "2025-07-31T07:30:53.259098Z", "iopub.status.idle": "2025-07-31T07:30:56.207017Z", "shell.execute_reply": "2025-07-31T07:30:56.206404Z" }, "papermill": { "duration": 2.954748, "end_time": "2025-07-31T07:30:56.208452", "exception": false, "start_time": "2025-07-31T07:30:53.253704", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import os, re, warnings\n", "\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "code", "execution_count": 2, "id": "3fef7e91", "metadata": { "execution": { "iopub.execute_input": "2025-07-31T07:30:56.217100Z", "iopub.status.busy": "2025-07-31T07:30:56.216792Z", "iopub.status.idle": "2025-07-31T07:30:56.326729Z", "shell.execute_reply": "2025-07-31T07:30:56.325825Z" }, "papermill": { "duration": 0.115872, "end_time": "2025-07-31T07:30:56.328285", "exception": false, "start_time": "2025-07-31T07:30:56.212413", "status": "completed" }, "tags": [] }, "outputs": [ { "data": { "text/html": [ "
| \n", " | Id_Number | \n", "Patient Question | \n", "Distorted part | \n", "Dominant Distortion | \n", "Secondary Distortion (Optional) | \n", "
|---|---|---|---|---|---|
| 0 | \n", "4500 | \n", "Hello, I have a beautiful,smart,outgoing and a... | \n", "The voice are always fimilar (someone she know... | \n", "Personalization | \n", "NaN | \n", "
| 1 | \n", "4501 | \n", "Since I was about 16 years old I’ve had these ... | \n", "I feel trapped inside my disgusting self and l... | \n", "Labeling | \n", "Emotional Reasoning | \n", "
| 2 | \n", "4502 | \n", "So I’ve been dating on and off this guy for a... | \n", "NaN | \n", "No Distortion | \n", "NaN | \n", "
| 3 | \n", "4503 | \n", "My parents got divorced in 2004. My mother has... | \n", "NaN | \n", "No Distortion | \n", "NaN | \n", "
| 4 | \n", "4504 | \n", "I don’t really know how to explain the situati... | \n", "I refused to go because I didn’t know if it wa... | \n", "Fortune-telling | \n", "Emotional Reasoning | \n", "
| \n", " | Id_Number | \n", "Patient Question | \n", "Distorted part | \n", "Dominant Distortion | \n", "Secondary Distortion (Optional) | \n", "
|---|---|---|---|---|---|
| 0 | \n", "4500 | \n", "Hello, I have a beautiful,smart,outgoing and a... | \n", "The voice are always fimilar (someone she know... | \n", "Personalization | \n", "NaN | \n", "
| 1 | \n", "4501 | \n", "Since I was about 16 years old I’ve had these ... | \n", "I feel trapped inside my disgusting self and l... | \n", "Labeling | \n", "Emotional Reasoning | \n", "
| 4 | \n", "4504 | \n", "I don’t really know how to explain the situati... | \n", "I refused to go because I didn’t know if it wa... | \n", "Fortune-telling | \n", "Emotional Reasoning | \n", "
| 9 | \n", "4510 | \n", "I have been with my fiancé for two years now.... | \n", "I felt like the response was totally irrationa... | \n", "Magnification | \n", "NaN | \n", "
| 10 | \n", "4511 | \n", "My husband and I have been married for over a ... | \n", "I thought that he displayed traits of honor, l... | \n", "Labeling | \n", "NaN | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 2519 | \n", "2553 | \n", "I feel overprotective about my mother because ... | \n", "Since then, whenever my mother is out alone, I... | \n", "All-or-nothing thinking | \n", "Overgeneralization | \n", "
| 2522 | \n", "2557 | \n", "From Lebanon: I am dealing with a big problem!... | \n", "My family hate him but they didn’t met him at ... | \n", "Magnification | \n", "NaN | \n", "
| 2523 | \n", "2559 | \n", "From the U.S.: I am a junior in high school, a... | \n", "However, I am not happy, at the least only hal... | \n", "Labeling | \n", "All-or-nothing thinking | \n", "
| 2526 | \n", "2563 | \n", "I am 21 female and have not had any friends fo... | \n", "Now I am at university my peers around me all ... | \n", "Overgeneralization | \n", "NaN | \n", "
| 2527 | \n", "2564 | \n", "From the U.S.: My brother is 19 years old and ... | \n", "He claims he’s severely depressed and has outb... | \n", "Mental filter | \n", "Mind Reading | \n", "
1597 rows × 5 columns
\n", "| \n", " | Id_Number | \n", "Patient Question | \n", "Distorted part | \n", "Dominant Distortion | \n", "Secondary Distortion (Optional) | \n", "
|---|---|---|---|---|---|
| 0 | \n", "4500 | \n", "Hello, I have a beautiful,smart,outgoing and a... | \n", "The voice are always fimilar (someone she know... | \n", "Personalization | \n", "NaN | \n", "
| 1 | \n", "4501 | \n", "Since I was about 16 years old I’ve had these ... | \n", "I feel trapped inside my disgusting self and l... | \n", "Labeling | \n", "Emotional Reasoning | \n", "
| 4 | \n", "4504 | \n", "I don’t really know how to explain the situati... | \n", "I refused to go because I didn’t know if it wa... | \n", "Fortune-telling | \n", "Emotional Reasoning | \n", "
| 9 | \n", "4510 | \n", "I have been with my fiancé for two years now.... | \n", "I felt like the response was totally irrationa... | \n", "Magnification | \n", "NaN | \n", "
| 10 | \n", "4511 | \n", "My husband and I have been married for over a ... | \n", "I thought that he displayed traits of honor, l... | \n", "Labeling | \n", "NaN | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 2519 | \n", "2553 | \n", "I feel overprotective about my mother because ... | \n", "Since then, whenever my mother is out alone, I... | \n", "All-or-nothing thinking | \n", "Overgeneralization | \n", "
| 2522 | \n", "2557 | \n", "From Lebanon: I am dealing with a big problem!... | \n", "My family hate him but they didn’t met him at ... | \n", "Magnification | \n", "NaN | \n", "
| 2523 | \n", "2559 | \n", "From the U.S.: I am a junior in high school, a... | \n", "However, I am not happy, at the least only hal... | \n", "Labeling | \n", "All-or-nothing thinking | \n", "
| 2526 | \n", "2563 | \n", "I am 21 female and have not had any friends fo... | \n", "Now I am at university my peers around me all ... | \n", "Overgeneralization | \n", "NaN | \n", "
| 2527 | \n", "2564 | \n", "From the U.S.: My brother is 19 years old and ... | \n", "He claims he’s severely depressed and has outb... | \n", "Mental filter | \n", "Mind Reading | \n", "
1597 rows × 5 columns
\n", "| \n", " | Id_Number | \n", "Patient Question | \n", "Distorted part | \n", "Dominant Distortion | \n", "Secondary Distortion (Optional) | \n", "cleaned | \n", "
|---|---|---|---|---|---|---|
| 0 | \n", "4500 | \n", "Hello, I have a beautiful,smart,outgoing and a... | \n", "The voice are always fimilar (someone she know... | \n", "Personalization | \n", "NaN | \n", "the voice are always fimilar someone she knows... | \n", "
| 1 | \n", "4501 | \n", "Since I was about 16 years old I’ve had these ... | \n", "I feel trapped inside my disgusting self and l... | \n", "Labeling | \n", "Emotional Reasoning | \n", "i feel trapped inside my disgusting self and l... | \n", "
| 4 | \n", "4504 | \n", "I don’t really know how to explain the situati... | \n", "I refused to go because I didn’t know if it wa... | \n", "Fortune-telling | \n", "Emotional Reasoning | \n", "i refused to go because i didn’t know if it wa... | \n", "
| 9 | \n", "4510 | \n", "I have been with my fiancé for two years now.... | \n", "I felt like the response was totally irrationa... | \n", "Magnification | \n", "NaN | \n", "i felt like the response was totally irrationa... | \n", "
| 10 | \n", "4511 | \n", "My husband and I have been married for over a ... | \n", "I thought that he displayed traits of honor, l... | \n", "Labeling | \n", "NaN | \n", "i thought that he displayed traits of honor lo... | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 2519 | \n", "2553 | \n", "I feel overprotective about my mother because ... | \n", "Since then, whenever my mother is out alone, I... | \n", "All-or-nothing thinking | \n", "Overgeneralization | \n", "since then whenever my mother is out alone i b... | \n", "
| 2522 | \n", "2557 | \n", "From Lebanon: I am dealing with a big problem!... | \n", "My family hate him but they didn’t met him at ... | \n", "Magnification | \n", "NaN | \n", "my family hate him but they didn’t met him at ... | \n", "
| 2523 | \n", "2559 | \n", "From the U.S.: I am a junior in high school, a... | \n", "However, I am not happy, at the least only hal... | \n", "Labeling | \n", "All-or-nothing thinking | \n", "however i am not happy at the least only half ... | \n", "
| 2526 | \n", "2563 | \n", "I am 21 female and have not had any friends fo... | \n", "Now I am at university my peers around me all ... | \n", "Overgeneralization | \n", "NaN | \n", "now i am at university my peers around me all ... | \n", "
| 2527 | \n", "2564 | \n", "From the U.S.: My brother is 19 years old and ... | \n", "He claims he’s severely depressed and has outb... | \n", "Mental filter | \n", "Mind Reading | \n", "he claims he’s severely depressed and has outb... | \n", "
1597 rows × 6 columns
\n", "