Skip to content

Commit 0dd1dc1

Browse files
committed
feat : 장르 추가
1 parent 298bbe5 commit 0dd1dc1

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/crawling/melonCrawler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class MelonCrawler:
1515
"hiphop": "GN0300",
1616
"randb": "GN0400",
1717
"indie": "GN0500",
18-
"rock": "GN0600"
18+
"rock": "GN0600",
19+
"fork": "GN0800"
1920
}
2021

2122
def __init__(self):

app/diary/router.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -554,16 +554,15 @@ async def create_diary_with_emotion_based_recommendation(
554554
combined_embedding = kobert.get_embedding(best_sentence)
555555

556556
emotion_to_genres = {
557-
0: ["댄스", "록/메탈"],
558-
1: ["인디음악", "댄스"],
559-
2: ["인디음악", "R&B/Soul"],
560-
3: ["R&B/Soul", "인디음악"],
561-
4: ["R&B/Soul", "인디음악"],
562-
5: ["발라드", "록/메탈"],
563-
6: ["발라드", "R&B/Soul"],
564-
7: ["랩/힙합", "록/메탈"]
557+
0: ["댄스", "록/메탈"], # 신남 → 에너지 + 감성 믹스
558+
1: ["인디음악", "댄스", "포크/블루스"], # 기대 → 발랄하거나 설레는 곡
559+
2: ["포크/블루스", "인디음악", "R&B/Soul"], # 편안 → 부드럽고 서정적인 계열
560+
3: ["포크/블루스", "인디음악", "R&B/Soul"], # 만족 → 감정 공감형 감성 음악
561+
4: ["포크/블루스", "인디음악", "R&B/Soul"], # 허무 → 무기력하거나 담담한 정서
562+
5: ["발라드", "포크/블루스"], # 우울 → 조용하거나 격한 감정 침잠
563+
6: ["발라드", "R&B/Soul", "포크/블루스"], # 슬픔 → 애절함 + 회상적 감정
564+
7: ["랩/힙합", "록/메탈"] # 분노 → 파워풀한 표현 위주
565565
}
566-
567566
genre_names = emotion_to_genres.get(emotion_id_full)
568567
if not genre_names:
569568
raise HTTPException(status_code=400, detail="감정에 대응되는 장르가 없습니다.")

0 commit comments

Comments
 (0)