Skip to content

Commit

Permalink
Merge pull request #133 from meghdadFar/feature/chatgpt
Browse files Browse the repository at this point in the history
Add ChatGPT support
  • Loading branch information
meghdadFar authored Apr 3, 2024
2 parents aceb4e6 + 3fb5edb commit bfa7125
Show file tree
Hide file tree
Showing 7 changed files with 2,245 additions and 1,523 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,7 @@ dmypy.json
# data
IMDB_Dataset.csv
IMDB_Dataset_tiny.csv
IMDB_Dataset_sample_5k.csv
IMDB_Dataset_sample_5k.csv

# Secretes
secrets/
47 changes: 33 additions & 14 deletions notebooks/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 1,
"id": "21155605",
"metadata": {},
"outputs": [],
Expand All @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 2,
"id": "cd3a6599",
"metadata": {},
"outputs": [],
Expand All @@ -57,14 +57,20 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 3,
"id": "48587d0d",
"metadata": {},
"outputs": [],
"source": [
"imdb_df = pd.read_csv(\"../data/IMDB_Dataset_sample_5k.csv\")"
]
},
{
"cell_type": "markdown",
"id": "cc8b99a9",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "8c578bb0",
Expand All @@ -75,25 +81,34 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 4,
"id": "1a67b922",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"core - 313 - INFO - Processing text in review column of the input DataFrame...\n",
"100%|██████████████████████████████████████████████████████████████████| 5000/5000 [00:31<00:00, 156.37it/s]\n",
"core - 354 - INFO - Calculating Empirical and Theoretical Zipf values...\n",
"core - 359 - INFO - Time to measure predicted proportion for 91519 rows: 0.032450199127197266\n"
"core - 335 - INFO - Processing text in review column of the input DataFrame...\n",
" 9%|▉ | 454/5000 [00:03<00:30, 151.49it/s]core - 353 - WARNING - Processing entry --- . . . or type on a computer keyboard, they'd probably give this eponymous film a rating of \"10.\" After all, no elephants are shown being killed during the movie; it is not even implied that any are hurt. To the contrary, the master of ELEPHANT WALK, John Wiley (Peter Finch), complains that he cannot shoot any of the pachyderms--no matter how menacing--without a permit from the government (and his tone suggests such permits are not within the realm of probability). Furthermore, the elements conspire--in the form of an unusual drought and a human cholera epidemic--to leave the Wiley plantation house vulnerable to total destruction by the Elephant People (as the natives dub them) to close the story. If you happen to see the current release EARTH, you'll detect the Elephant People are faring less well today. --- lead to exception: list index out of range\n",
"100%|██████████| 5000/5000 [00:34<00:00, 144.33it/s]\n",
"core - 378 - INFO - Calculating Empirical and Theoretical Zipf values...\n",
"core - 383 - INFO - Time to measure predicted proportion for 91510 rows: 0.02987194061279297\n"
]
}
],
"source": [
"tsp = TextStatsPlots(df=imdb_df, text_column='review')"
]
},
{
"cell_type": "markdown",
"id": "563ad310",
"metadata": {},
"source": [
"### Chat"
]
},
{
"cell_type": "markdown",
"id": "b2bbbc42",
Expand All @@ -104,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 4,
"id": "9bad5bb6",
"metadata": {},
"outputs": [
Expand All @@ -115,19 +130,23 @@
"┌───────────────────┬─────────┐\n",
"│ Language/s │ EN │\n",
"├───────────────────┼─────────┤\n",
"│ Unique Words │ 91,519\n",
"│ Unique Words │ 91,510\n",
"├───────────────────┼─────────┤\n",
"│ All Words │ 625,022\n",
"│ All Words │ 624,945\n",
"├───────────────────┼─────────┤\n",
"│ Documents │ 5,000 │\n",
"├───────────────────┼─────────┤\n",
"│ Median Doc Length │ 174.0 │\n",
"├───────────────────┼─────────┤\n",
"│ Nouns │ 57,001 │\n",
"│ Nouns │ 56,995 │\n",
"├───────────────────┼─────────┤\n",
"│ Adjectives │ 32,189 │\n",
"├───────────────────┼─────────┤\n",
"│ Verbs │ 21,240 │\n",
"├───────────────────┼─────────┤\n",
"Adjectives │ 32,191\n",
"Proper Nouns │ 5,663 \n",
"├───────────────────┼─────────┤\n",
"Verbs │ 21,244\n",
"Adverbs │ 5,759 \n",
"└───────────────────┴─────────┘\n"
]
}
Expand Down
Loading

0 comments on commit bfa7125

Please sign in to comment.