Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ce59b88
initial commit
Gumraze-git Jul 10, 2025
bce49f9
[FEAT] ๊ฐ์ • ๋ถ„์„ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
bf616ba
[REFAC] ๋ถˆํ•„์š”ํ•œ ์ฃผ์„ ์ œ๊ฑฐ
Gumraze-git Jul 11, 2025
f89a425
[FEAT] ๊ฐ์ • ์ƒํƒœ ์ƒ์ˆ˜ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
18f7b42
[FEAT] ์„ค์ • ํŒŒ์ผ ์ˆ˜์ • ๋ฐ ๋ชจ๋ธ ๊ฒฝ๋กœ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
2968fe4
[FEAT] ๊ฐ์ • ์˜ˆ์ธก ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
742123c
[FEAT] ๊ฐ์ • ์˜ˆ์ธก ํ•จ์ˆ˜ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
5d9f73c
[FEAT] Pydantic ๋ฐ์ดํ„ฐ ์Šคํ‚ค๋งˆ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
551f476
[FEAT] ๊ฐ์ • ์˜ˆ์ธก ๋ผ์šฐํ„ฐ ๋“ฑ๋ก
Gumraze-git Jul 11, 2025
7087eb0
[FEAT] KoBERT ๊ฐ์ • ๋ถ„์„ ๋ชจ๋ธ ํŒŒ์ผ ์ถ”๊ฐ€
Gumraze-git Jul 11, 2025
809b493
[FEAT] ๊ฐ์ • ๋ถ„์„ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์ฆ๊ฐ• ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€
Gumraze-git Jul 12, 2025
be40c9e
[FEAT] KoBERT 5 ๋ฐ 6 ๊ฐ์ • ๋ถ„์„ ๋ชจ๋ธ ํŒŒ์ผ ์ถ”๊ฐ€
Gumraze-git Jul 12, 2025
a6f36c1
[FEAT] ๊ฐ์ • ์ƒํƒœ ์ƒ์ˆ˜ ์—…๋ฐ์ดํŠธ
Gumraze-git Jul 12, 2025
c6565ac
[REFAC] KoBERT 7๊ฐ€์ง€ ๊ฐ์ • ๋ถ„์„ ๋ชจ๋ธ ํŒŒ์ผ ์ด๋ฆ„ ์ˆ˜์ •
Gumraze-git Jul 12, 2025
23e0199
[FEAT] KoBERT 5๊ฐ€์ง€ ๊ฐ์ • ๋ถ„์„ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •
Gumraze-git Jul 12, 2025
b441d67
[FIX] ๋ชจ๋ธ ๋””๋ ‰ํ„ฐ๋ฆฌ ๊ฒฝ๋กœ ์ˆ˜์ •
Gumraze-git Jul 12, 2025
1f770d0
[FIX] LABELS_6 ๋ฐ LABELS_5 ์ƒ์ˆ˜ ์ˆ˜์ •
Gumraze-git Jul 12, 2025
fedcba3
[FEAT] KoBERT 5๊ฐ€์ง€ ๊ฐ์ • ๋ถ„์„ ๊ฒฐ๊ณผ ๋ฐ˜ํ™˜ ๋กœ์ง ์ˆ˜์ •
Gumraze-git Jul 12, 2025
1fd1d2c
[CHORE] LABELS_7 ๋ผ๋ฒจ ์ˆœ์„œ ํ™•์ธ ๋ฐ ์ˆ˜์ • ํ•„์š”
Gumraze-git Jul 12, 2025
ac2ed83
[CHORE] ๋ชจ๋ธ ๊ฐ€์ค‘์น˜ ํŒŒ์ผ Git LFS๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ์ด๋™
Gumraze-git Jul 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
models/**/*.safetensors filter=lfs diff=lfs merge=lfs -text
models/**/*.spiece.model filter=lfs diff=lfs merge=lfs -text
8 changes: 4 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# config.py
import os
from pydantic_settings import BaseSettings, SettingsConfigDict

class Settings(BaseSettings):
db_name: str = "emotion_db"
mongodb_uri: str = "mongodb://localhost:27017"
db_name: str = "emotion_db"
collection_name: str = "predictions"
title: str = "Inside Movie AI"
model_dir: str = os.getenv("MODEL_DIR", "models/0712_kobert_5_emotion_model")
title: str = "MovieMood - KoBERT Emotion API"

# .env ํŒŒ์ผ ์ž๋™ ๋กœ๋”ฉ ์„ค์ •
model_config = SettingsConfigDict(env_file=".env")

settings = Settings()
12 changes: 12 additions & 0 deletions const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 7 ๊ฐ€์ง€ ๊ฐ์ • ์ƒํƒœ
# ๊ธฐ์จ, ์Šฌํ””, ๋ถ„๋…ธ, ๋†€๋žŒ, ํ˜์˜ค, ๊ณตํฌ, ์ค‘๋ฆฝ
# TODO: 7๊ฐœ ๋ผ๋ฒจ์˜ ๋ผ๋ฒจ๋ง ์ˆœ์„œ ์—‰ํ‚ด. ๋ผ๋ฒจ ์ˆœ์„œ ํ™•์ธํ•˜์—ฌ ์ˆ˜์ • ํ•„์š”ํ•จ.
LABELS_7 = [
"happiness", "sadness", "anger", "surprise", "disgust", "fear", "neutral"
]
LABELS_6 = [
"anger", "fear", "happiness", "neutral", "sadness", "surprise"
]
LABELS_5 = [
"anger", "fear", "happiness", "neutral", "sadness"
]
38,595 changes: 38,595 additions & 0 deletions data/emotion_data.csv

Large diffs are not rendered by default.

40,076 changes: 40,076 additions & 0 deletions data/emotions_augmented_0712.csv

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# app/db.py
from motor.motor_asyncio import AsyncIOMotorClient
from config import settings

Expand Down
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# main.py
import uvicorn
from fastapi import FastAPI
from config import settings
from db import collection
from routers.home import router as home_router
from routers.predict import router as predict_router

app = FastAPI(title=settings.title)

# ๋ผ์šฐํ„ฐ ๋“ฑ๋ก
app.include_router(home_router)
app.include_router(predict_router)

if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
46 changes: 46 additions & 0 deletions models/0711_kobert_7_emotion_model/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"architectures": [
"BertForSequenceClassification"
],
"attention_probs_dropout_prob": 0.1,
"author": "Heewon Jeon(madjakarta@gmail.com)",
"classifier_dropout": null,
"gradient_checkpointing": false,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2",
"3": "LABEL_3",
"4": "LABEL_4",
"5": "LABEL_5",
"6": "LABEL_6"
},
"initializer_range": 0.02,
"intermediate_size": 3072,
"kobert_version": 1.0,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2,
"LABEL_3": 3,
"LABEL_4": 4,
"LABEL_5": 5,
"LABEL_6": 6
},
"layer_norm_eps": 1e-12,
"max_position_embeddings": 512,
"model_type": "bert",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 1,
"position_embedding_type": "absolute",
"problem_type": "single_label_classification",
"torch_dtype": "float32",
"transformers_version": "4.53.1",
"type_vocab_size": 2,
"use_cache": true,
"vocab_size": 8002
}
3 changes: 3 additions & 0 deletions models/0711_kobert_7_emotion_model/model.safetensors
Git LFS file not shown
15 changes: 15 additions & 0 deletions models/0711_kobert_7_emotion_model/special_tokens_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bos_token": "[CLS]",
"cls_token": "[CLS]",
"eos_token": "[SEP]",
"mask_token": {
"content": "[MASK]",
"lstrip": true,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": "[PAD]",
"sep_token": "[SEP]",
"unk_token": "[UNK]"
}
Binary file added models/0711_kobert_7_emotion_model/spiece.model
Binary file not shown.
60 changes: 60 additions & 0 deletions models/0711_kobert_7_emotion_model/tokenizer_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"added_tokens_decoder": {
"0": {
"content": "[UNK]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "[PAD]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "[CLS]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "[SEP]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "[MASK]",
"lstrip": true,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [],
"bos_token": "[CLS]",
"clean_up_tokenization_spaces": false,
"cls_token": "[CLS]",
"do_lower_case": false,
"eos_token": "[SEP]",
"extra_special_tokens": {},
"keep_accents": false,
"mask_token": "[MASK]",
"model_max_length": 1000000000000000019884624838656,
"pad_token": "[PAD]",
"remove_space": true,
"sep_token": "[SEP]",
"sp_model_kwargs": {},
"tokenizer_class": "KoBERTTokenizer",
"unk_token": "[UNK]"
}
42 changes: 42 additions & 0 deletions models/0712_kobert_5_emotion_model/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"architectures": [
"BertForSequenceClassification"
],
"attention_probs_dropout_prob": 0.1,
"author": "Heewon Jeon(madjakarta@gmail.com)",
"classifier_dropout": null,
"gradient_checkpointing": false,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2",
"3": "LABEL_3",
"4": "LABEL_4"
},
"initializer_range": 0.02,
"intermediate_size": 3072,
"kobert_version": 1.0,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2,
"LABEL_3": 3,
"LABEL_4": 4
},
"layer_norm_eps": 1e-12,
"max_position_embeddings": 512,
"model_type": "bert",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 1,
"position_embedding_type": "absolute",
"problem_type": "single_label_classification",
"torch_dtype": "float32",
"transformers_version": "4.53.1",
"type_vocab_size": 2,
"use_cache": true,
"vocab_size": 8002
}
3 changes: 3 additions & 0 deletions models/0712_kobert_5_emotion_model/model.safetensors
Git LFS file not shown
15 changes: 15 additions & 0 deletions models/0712_kobert_5_emotion_model/special_tokens_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bos_token": "[CLS]",
"cls_token": "[CLS]",
"eos_token": "[SEP]",
"mask_token": {
"content": "[MASK]",
"lstrip": true,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": "[PAD]",
"sep_token": "[SEP]",
"unk_token": "[UNK]"
}
Binary file added models/0712_kobert_5_emotion_model/spiece.model
Binary file not shown.
64 changes: 64 additions & 0 deletions models/0712_kobert_5_emotion_model/tokenizer_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"added_tokens_decoder": {
"0": {
"content": "[UNK]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "[PAD]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "[CLS]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "[SEP]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "[MASK]",
"lstrip": true,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [],
"bos_token": "[CLS]",
"clean_up_tokenization_spaces": false,
"cls_token": "[CLS]",
"do_lower_case": false,
"eos_token": "[SEP]",
"extra_special_tokens": {},
"keep_accents": false,
"mask_token": "[MASK]",
"model_max_length": 1000000000000000019884624838656,
"pad_token": "[PAD]",
"remove_space": true,
"sep_token": "[SEP]",
"sp_model_kwargs": {
"alpha": 0.6,
"enable_sampling": true,
"nbest_size": -1
},
"tokenizer_class": "KoBERTTokenizer",
"unk_token": "[UNK]"
}
44 changes: 44 additions & 0 deletions models/0712_kobert_6_emotion_model/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"architectures": [
"BertForSequenceClassification"
],
"attention_probs_dropout_prob": 0.1,
"author": "Heewon Jeon(madjakarta@gmail.com)",
"classifier_dropout": null,
"gradient_checkpointing": false,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2",
"3": "LABEL_3",
"4": "LABEL_4",
"5": "LABEL_5"
},
"initializer_range": 0.02,
"intermediate_size": 3072,
"kobert_version": 1.0,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2,
"LABEL_3": 3,
"LABEL_4": 4,
"LABEL_5": 5
},
"layer_norm_eps": 1e-12,
"max_position_embeddings": 512,
"model_type": "bert",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 1,
"position_embedding_type": "absolute",
"problem_type": "single_label_classification",
"torch_dtype": "float32",
"transformers_version": "4.53.1",
"type_vocab_size": 2,
"use_cache": true,
"vocab_size": 8002
}
3 changes: 3 additions & 0 deletions models/0712_kobert_6_emotion_model/model.safetensors
Git LFS file not shown
15 changes: 15 additions & 0 deletions models/0712_kobert_6_emotion_model/special_tokens_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bos_token": "[CLS]",
"cls_token": "[CLS]",
"eos_token": "[SEP]",
"mask_token": {
"content": "[MASK]",
"lstrip": true,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": "[PAD]",
"sep_token": "[SEP]",
"unk_token": "[UNK]"
}
Binary file added models/0712_kobert_6_emotion_model/spiece.model
Binary file not shown.
Loading