소스 검색

fix: qa regex (#1738)

tags/0.3.34
crazywoola 1 년 전
부모
커밋
994fceece3
No account linked to committer's email address
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      api/core/indexing_runner.py

+ 2
- 2
api/core/indexing_runner.py 파일 보기

return text return text


def format_split_text(self, text): def format_split_text(self, text):
regex = r"Q\d+:\s*(.*?)\s*A\d+:\s*([\s\S]*?)(?=Q|$)"
matches = re.findall(regex, text, re.MULTILINE)
regex = r"Q\d+:\s*(.*?)\s*A\d+:\s*([\s\S]*?)(?=Q\d+:|$)"
matches = re.findall(regex, text, re.UNICODE)


return [ return [
{ {

Loading…
취소
저장