diff --git a/rag/nlp/synonym.py b/rag/nlp/synonym.py index 8c2418b..becc4fb 100644 --- a/rag/nlp/synonym.py +++ b/rag/nlp/synonym.py @@ -30,7 +30,7 @@ def __init__(self, redis=None): self.dictionary = None path = os.path.join(get_project_base_directory(), "rag/res", "synonym.json") try: - self.dictionary = json.load(open(path, "r")) + self.dictionary = json.load(open(path, "r", encoding="utf-8")) except Exception: logging.warning("Missing synonym.json") self.dictionary = {} diff --git a/rag/nlp/term_weight.py b/rag/nlp/term_weight.py index df4d2a9..e01d1a0 100644 --- a/rag/nlp/term_weight.py +++ b/rag/nlp/term_weight.py @@ -85,7 +85,7 @@ def load_dict(fnm): fnm = os.path.join(get_project_base_directory(), "rag/res") self.ne, self.df = {}, {} try: - self.ne = json.load(open(os.path.join(fnm, "ner.json"), "r")) + self.ne = json.load(open(os.path.join(fnm, "ner.json"), "r", encoding="utf-8")) except Exception: logging.warning("Load ner.json FAIL!") try: diff --git a/rag/prompts.py b/rag/prompts.py index 34e6499..0836118 100644 --- a/rag/prompts.py +++ b/rag/prompts.py @@ -201,7 +201,7 @@ def citation_prompt(): : 埃隆·马斯克对 Dogecoin 的看法是什么? -: 马斯克一贯表达了对 Dogecoin 的喜爱,常常提及其幽默感和品牌中狗的元素。他曾表示这是他最喜欢的加密货币 ##0 ##1。 +: 马斯克一贯表达了对 Dogecoin 的喜爱,常常提及其幽默感和品牌中狗的元素。他曾表示这是他最喜欢的加密货币 ##0$$ ##1$$。 最近,马斯克暗示 Dogecoin 未来可能会有新的应用场景。他的推文引发了关于 Dogecoin 可能被整合到公共服务中的猜测 ##3$$。 总体而言,虽然马斯克喜欢 Dogecoin 并经常推广它,但他也警告不要过度投资,反映了他对其投机性质的既喜爱又谨慎的态度。