wiizm commited on
Commit
0e8e2dd
·
verified ·
1 Parent(s): 0adcd58

Upload app\prompts\metadata.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app//prompts//metadata.py +41 -0
app//prompts//metadata.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ 메타데이터 추출 프롬프트
3
+ """
4
+
5
+ from typing import Optional
6
+
7
+
8
+ def get_metadata_extraction_prompt(
9
+ chunk_content: str,
10
+ max_length: int = 2000
11
+ ) -> str:
12
+ """
13
+ 청크 메타데이터 추출을 위한 프롬프트 생성
14
+
15
+ Args:
16
+ chunk_content: 분석할 청크 내용
17
+ max_length: 프롬프트에 포함할 최대 텍스트 길이
18
+
19
+ Returns:
20
+ 프롬프트 문자열
21
+ """
22
+ content_preview = chunk_content[:max_length]
23
+
24
+ prompt = f"""다음 웹소설 텍스트를 분석하여 아래 정보를 JSON 형식으로만 응답하세요:
25
+
26
+ 텍스트:
27
+ {content_preview}
28
+
29
+ 다음 형식으로만 응답하세요 (JSON 형식):
30
+ {{
31
+ "pov": "화자/시점을 설명하세요 (예: 1인칭 주인공, 3인칭 전지적 작가 등)",
32
+ "characters": ["등장인물1", "등장인물2"],
33
+ "time_background": "시간적 배경 설명 (예: 과거 회상, 현재 시점, 미래 등)"
34
+ }}
35
+
36
+ 응답은 오직 JSON 형식만 사용하고, 다른 설명은 포함하지 마세요."""
37
+
38
+ return prompt
39
+
40
+
41
+