sample-usage.ipynb 4.11 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "62ed5f3f-e370-44eb-ad35-39e1ef0627b6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   participant_decision participant_certaintity model_class  model_probability\n",
      "57              trujący           średnio pewny     jadalny               0.54\n",
      "58              jadalny           średnio pewny     jadalny               0.95\n",
      "59              jadalny      zdecydowanie pewny     trujący               1.00\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>speaker_id</th>\n",
       "      <th>problem_id</th>\n",
       "      <th>text</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>MW_SSH_05</td>\n",
       "      <td>__P1__</td>\n",
       "      <td>Ok. Średnica 17,30... Mogę po całej kartce?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>MW</td>\n",
       "      <td>__P1__</td>\n",
       "      <td>Jasne, proszę sobie mazać spokojnie.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>MW_SSH_05</td>\n",
       "      <td>__P1__</td>\n",
       "      <td>Ok to wróćmy do… To była wysokość, średnica ka...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    speaker_id problem_id                                               text\n",
       "180  MW_SSH_05     __P1__        Ok. Średnica 17,30... Mogę po całej kartce?\n",
       "181         MW     __P1__               Jasne, proszę sobie mazać spokojnie.\n",
       "182  MW_SSH_05     __P1__  Ok to wróćmy do… To była wysokość, średnica ka..."
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "\n",
    "#select participant which ouy would like to investigate\n",
    "participant_id = 'MW_SSH_05'\n",
    "\n",
    "problems = pd.read_csv('./zenodo/PROBLEMS.csv')\n",
    "responses = pd.read_csv('./zenodo/PROBLEMS_RESPONSES.csv')\n",
    "merged_problems = pd.merge(responses,problems, on='problem_id')\n",
    "\n",
    "prediction_features = ['participant_decision','participant_certaintity',\n",
    "                       'model_class','model_probability']\n",
    "print(merged_problems[merged_problems['participant_id']==participant_id][prediction_features])\n",
    "\n",
    "#retrieve related text that correspond to the problem P1 of a particiapnt MZ_SSH_04\n",
    "transcripts = pd.read_csv(f'./zenodo/transcripts/{participant_id}.csv')\n",
    "transcripts['problem_id'] = transcripts['problem_id'].ffill().dropna()\n",
    "transcripts[transcripts['problem_id'] == '__P1__'].dropna(axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "55e60f6b-59ac-4b3d-9a6e-2153e50f34a1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}