Переглянути джерело

examples empty in categorize (#1422)

### What problem does this PR solve?

Examples empty in categorize

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.8.0
KevinHuSh 1 рік тому
джерело
коміт
c889ef6363
Аккаунт користувача з таким Email не знайдено
2 змінених файлів з 2 додано та 2 видалено
  1. 1
    1
      graph/component/categorize.py
  2. 1
    1
      rag/nlp/term_weight.py

+ 1
- 1
graph/component/categorize.py Переглянути файл

@@ -43,7 +43,7 @@ class CategorizeParam(GenerateParam):
def get_prompt(self):
cate_lines = []
for c, desc in self.category_description.items():
for l in desc["examples"].split("\n"):
for l in desc.get("examples", "").split("\n"):
if not l: continue
cate_lines.append("Question: {}\tCategory: {}".format(l, c))
descriptions = []

+ 1
- 1
rag/nlp/term_weight.py Переглянути файл

@@ -107,7 +107,7 @@ class Dealer:
if re.match(p, t):
tk = "#"
break
tk = re.sub(r"([\+\\-])", r"\\\1", tk)
#tk = re.sub(r"([\+\\-])", r"\\\1", tk)
if tk != "#" and tk:
res.append(tk)
return res

Завантаження…
Відмінити
Зберегти