Llama의 답변이 맥락+질문+답변의 형태로 출력되는 문제 발생
문자열 파싱 함수를 만들어 답변만 반환하여 해결
def extract_origin_text(data: str) -> str:
"""
Extract the origin text from the result text
result_text: str
"""
result_text = data
# extract the origin text
match = re.search(r"(\n\nOrigin:.*?\n\n)", result_text, re.DOTALL)
if match:
return match.group(1).strip()
return ""
'개발일지 > BrewWing' 카테고리의 다른 글
| TroubleShooting: 번역 텍스트 줄바꿈 없어짐 문제 (0) | 2025.02.04 |
|---|---|
| 번역 기능 추가 (1) | 2025.02.04 |
| TroubleShooting: 답변 줄 정리 (0) | 2025.01.29 |
| 데이터 전처리 (0) | 2025.01.04 |
| 데이터 분석 (0) | 2025.01.04 |