diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..0fb5507 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..3f552f9 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,28 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/interro_robot_tool.iml b/.idea/interro_robot_tool.iml new file mode 100644 index 0000000..c0f1096 --- /dev/null +++ b/.idea/interro_robot_tool.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..51993a2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..d8eea58 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PaddelSpeech.py b/PaddelSpeech.py new file mode 100644 index 0000000..2367f09 --- /dev/null +++ b/PaddelSpeech.py @@ -0,0 +1,3 @@ +from paddlespeech.cli.tts.infer import TTSExecutor +tts = TTSExecutor() +tts(text="今天天气十分不错。", output="output.wav") \ No newline at end of file diff --git a/README.md b/README.md index 55a8d8c..694edcf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ -# interro_robot_tool +# Interro_robot_tool -审讯机器人算法工具 \ No newline at end of file +审讯小机器人 + +## 安装说明 + +这个项目需要在 Conda 环境中运行。以下是安装的步骤: + +### 1. 安装 Conda + +如果您尚未安装 Conda,请根据您的操作系统安装 Miniconda 或 Anaconda。您可以从以下链接下载并安装 Conda: + +- [Miniconda](https://docs.conda.io/en/latest/miniconda.html) +- [Anaconda](https://www.anaconda.com/products/distribution) + +### 2. 创建虚拟环境 + +打开终端(或命令提示符),并输入以下命令以创建名为`qa_env`的 Conda 虚拟环境,确保使用 Python 3.10: + +```bash +conda create --name qa_env python=3.10 +``` + +### 3. 激活虚拟环境 +一旦环境创建完成,您需要激活虚拟环境。在 Windows 上,您可以使用以下命令 + +```bash +conda activate qa_env +``` + + +### 4. 安装对应包 + +```bash +pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple +``` + + +### 5. 进入项目目录,运行接口程序 + +``` +cd virtual_patient_qa +python fast_api.py +``` \ No newline at end of file diff --git a/Similarity_calculation_tool/.gitignore b/Similarity_calculation_tool/.gitignore deleted file mode 100644 index ef8e7ae..0000000 --- a/Similarity_calculation_tool/.gitignore +++ /dev/null @@ -1,163 +0,0 @@ -# ---> Python -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class -idea/ -.idea/ -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - diff --git a/Similarity_calculation_tool/README.md b/Similarity_calculation_tool/README.md deleted file mode 100644 index 12f8cdc..0000000 --- a/Similarity_calculation_tool/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Similarity_calculation_tool - -相似度问题判断工具 - -## 安装说明 - -这个项目需要在 Conda 环境中运行。以下是安装的步骤: - -### 1. 安装 Conda - -如果您尚未安装 Conda,请根据您的操作系统安装 Miniconda 或 Anaconda。您可以从以下链接下载并安装 Conda: - -- [Miniconda](https://docs.conda.io/en/latest/miniconda.html) -- [Anaconda](https://www.anaconda.com/products/distribution) - -### 2. 创建虚拟环境 - -打开终端(或命令提示符),并输入以下命令以创建名为`qa_env`的 Conda 虚拟环境,确保使用 Python 3.10: - -```bash -conda create --name qa_env python=3.10 -``` - -### 3. 激活虚拟环境 -一旦环境创建完成,您需要激活虚拟环境。在 Windows 上,您可以使用以下命令 - -```bash -conda activate qa_env -``` - - -### 4. 安装对应包 - -```bash -pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple -``` - - -### 5. 进入项目目录,运行接口程序 - -``` -cd virtual_patient_qa -python fast_api.py -``` \ No newline at end of file diff --git a/Similarity_calculation_tool/config/knowledge_base_names.txt b/Similarity_calculation_tool/config/knowledge_base_names.txt deleted file mode 100644 index 481cd84..0000000 --- a/Similarity_calculation_tool/config/knowledge_base_names.txt +++ /dev/null @@ -1,2 +0,0 @@ -cfee1e07-744b-45d4-985a-db344ce1cd98 -f19754c8-6d82-4446-b019-81521fe78763 \ No newline at end of file diff --git a/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.faiss b/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.faiss deleted file mode 100644 index e9815be..0000000 Binary files a/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.faiss and /dev/null differ diff --git a/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.pkl b/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.pkl deleted file mode 100644 index e5e12d6..0000000 Binary files a/Similarity_calculation_tool/knowledge_base/cfee1e07-744b-45d4-985a-db344ce1cd98/vector_store/FAISS/index.pkl and /dev/null differ diff --git a/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.faiss b/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.faiss deleted file mode 100644 index e9815be..0000000 Binary files a/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.faiss and /dev/null differ diff --git a/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.pkl b/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.pkl deleted file mode 100644 index e5e12d6..0000000 Binary files a/Similarity_calculation_tool/knowledge_base/f19754c8-6d82-4446-b019-81521fe78763/vector_store/FAISS/index.pkl and /dev/null differ diff --git a/Similarity_calculation_tool/base_kb.py b/base_kb.py similarity index 100% rename from Similarity_calculation_tool/base_kb.py rename to base_kb.py diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/1_Pooling/config.json b/bge-large-zh-v1.5/1_Pooling/config.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/1_Pooling/config.json rename to bge-large-zh-v1.5/1_Pooling/config.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/README.md b/bge-large-zh-v1.5/README.md similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/README.md rename to bge-large-zh-v1.5/README.md diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/config.json b/bge-large-zh-v1.5/config.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/config.json rename to bge-large-zh-v1.5/config.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/config_sentence_transformers.json b/bge-large-zh-v1.5/config_sentence_transformers.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/config_sentence_transformers.json rename to bge-large-zh-v1.5/config_sentence_transformers.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/model.safetensors b/bge-large-zh-v1.5/model.safetensors similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/model.safetensors rename to bge-large-zh-v1.5/model.safetensors diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/modules.json b/bge-large-zh-v1.5/modules.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/modules.json rename to bge-large-zh-v1.5/modules.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/pytorch_model.bin b/bge-large-zh-v1.5/pytorch_model.bin similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/pytorch_model.bin rename to bge-large-zh-v1.5/pytorch_model.bin diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/sentence_bert_config.json b/bge-large-zh-v1.5/sentence_bert_config.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/sentence_bert_config.json rename to bge-large-zh-v1.5/sentence_bert_config.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/special_tokens_map.json b/bge-large-zh-v1.5/special_tokens_map.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/special_tokens_map.json rename to bge-large-zh-v1.5/special_tokens_map.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/tokenizer.json b/bge-large-zh-v1.5/tokenizer.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/tokenizer.json rename to bge-large-zh-v1.5/tokenizer.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/tokenizer_config.json b/bge-large-zh-v1.5/tokenizer_config.json similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/tokenizer_config.json rename to bge-large-zh-v1.5/tokenizer_config.json diff --git a/Similarity_calculation_tool/bge-large-zh-v1.5/vocab.txt b/bge-large-zh-v1.5/vocab.txt similarity index 100% rename from Similarity_calculation_tool/bge-large-zh-v1.5/vocab.txt rename to bge-large-zh-v1.5/vocab.txt diff --git a/Similarity_calculation_tool/config/config.yaml b/config/config.yaml similarity index 100% rename from Similarity_calculation_tool/config/config.yaml rename to config/config.yaml diff --git a/config/knowledge_base_names.txt b/config/knowledge_base_names.txt new file mode 100644 index 0000000..0f144fb --- /dev/null +++ b/config/knowledge_base_names.txt @@ -0,0 +1,2 @@ +a0f9848b-2d65-4b37-85ca-6712061f01c0 +38de6667-4f5d-4f0a-8165-992ab76c1424 \ No newline at end of file diff --git a/Similarity_calculation_tool/faiss_cache.py b/faiss_cache.py similarity index 100% rename from Similarity_calculation_tool/faiss_cache.py rename to faiss_cache.py diff --git a/Similarity_calculation_tool/faiss_kb_service.py b/faiss_kb_service.py similarity index 100% rename from Similarity_calculation_tool/faiss_kb_service.py rename to faiss_kb_service.py diff --git a/Similarity_calculation_tool/fast_api.py b/fast_api.py similarity index 79% rename from Similarity_calculation_tool/fast_api.py rename to fast_api.py index 070dda2..c7f1308 100644 --- a/Similarity_calculation_tool/fast_api.py +++ b/fast_api.py @@ -29,7 +29,7 @@ logger = logging.getLogger(__name__) class QuestionRequest(BaseModel): question: str - + scoreThreshold: float class QuestionResponse(BaseModel): @@ -39,7 +39,7 @@ class QuestionResponse(BaseModel): class QuestionItem(BaseModel): - questionCode: str + questionId: str questionList: list[str] @@ -83,26 +83,6 @@ def update_kb(kb_name, qa_service, path, max_knowledge_bases): f"Please wait while the database is being updated···") -def fetch_and_write_data(api_url, path): - """从API获取数据并写入文件""" - try: - response = requests.get(api_url) - response_data = response.json() - - if response.status_code == 200 and response_data["code"] == 200: - question_items = response_data["data"] - - with open(path, "w", encoding="utf-8") as file: - json.dump(question_items, file, ensure_ascii=False, indent=2) - - return True - else: - logger.error(f"Failed to fetch data from API. Status code: {response.status_code}, Response data: {response_data}") - return False - except Exception as e: - logger.error(f"Error fetching data from API: {e}") - return False - @app.post("/updateDatabase") async def save_to_json(question_items: list[QuestionItem], background_tasks: BackgroundTasks): @@ -141,12 +121,11 @@ def match_question(request: QuestionRequest): newest = recent_knowledge_bases[-1] top_k = 3 - score_threshold = 0.1 device = None qa_service = QAService(newest, device) - result = match_query(qa_service, query, top_k, score_threshold) + result = match_query(qa_service, query, top_k, request.scoreThreshold) response = QuestionResponse(code=200, msg="success", data=result) stop_time = time.time() @@ -162,11 +141,6 @@ def match_question(request: QuestionRequest): recent_knowledge_bases = deque(load_knowledge_bases(), maxlen=max_knowledge_bases) -if fetch_and_write_data(api_url, path): - kb_name = str(uuid.uuid4()) - device = None - qa_service = QAService(kb_name, device) - update_kb(kb_name, qa_service, path, max_knowledge_bases) if __name__ == "__main__": import uvicorn diff --git a/Similarity_calculation_tool/kb_config.py b/kb_config.py similarity index 100% rename from Similarity_calculation_tool/kb_config.py rename to kb_config.py diff --git a/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.faiss b/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.faiss new file mode 100644 index 0000000..11f3caf Binary files /dev/null and b/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.faiss differ diff --git a/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.pkl b/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.pkl new file mode 100644 index 0000000..0747df7 Binary files /dev/null and b/knowledge_base/38de6667-4f5d-4f0a-8165-992ab76c1424/vector_store/FAISS/index.pkl differ diff --git a/Similarity_calculation_tool/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.faiss b/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.faiss similarity index 100% rename from Similarity_calculation_tool/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.faiss rename to knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.faiss diff --git a/Similarity_calculation_tool/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.pkl b/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.pkl similarity index 100% rename from Similarity_calculation_tool/knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.pkl rename to knowledge_base/3e6eef9a-7bea-4a35-8312-088a921cebac/vector_store/FAISS/index.pkl diff --git a/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.faiss b/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.faiss new file mode 100644 index 0000000..b32ecde Binary files /dev/null and b/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.faiss differ diff --git a/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.pkl b/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.pkl new file mode 100644 index 0000000..377bfaf Binary files /dev/null and b/knowledge_base/74dffff8-590f-4f1e-8440-7a45e7aad169/vector_store/FAISS/index.pkl differ diff --git a/Similarity_calculation_tool/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.faiss b/knowledge_base/a0f9848b-2d65-4b37-85ca-6712061f01c0/vector_store/FAISS/index.faiss similarity index 100% rename from Similarity_calculation_tool/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.faiss rename to knowledge_base/a0f9848b-2d65-4b37-85ca-6712061f01c0/vector_store/FAISS/index.faiss diff --git a/Similarity_calculation_tool/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.pkl b/knowledge_base/a0f9848b-2d65-4b37-85ca-6712061f01c0/vector_store/FAISS/index.pkl similarity index 100% rename from Similarity_calculation_tool/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.pkl rename to knowledge_base/a0f9848b-2d65-4b37-85ca-6712061f01c0/vector_store/FAISS/index.pkl diff --git a/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.faiss b/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.faiss new file mode 100644 index 0000000..b32ecde Binary files /dev/null and b/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.faiss differ diff --git a/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.pkl b/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.pkl new file mode 100644 index 0000000..377bfaf Binary files /dev/null and b/knowledge_base/a9281337-4313-4699-a49c-68da829c4884/vector_store/FAISS/index.pkl differ diff --git a/Similarity_calculation_tool/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.faiss b/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.faiss similarity index 100% rename from Similarity_calculation_tool/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.faiss rename to knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.faiss diff --git a/Similarity_calculation_tool/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.pkl b/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.pkl similarity index 100% rename from Similarity_calculation_tool/knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.pkl rename to knowledge_base/db5f0e79-263d-46f0-a959-a48e32390d53/vector_store/FAISS/index.pkl diff --git a/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.faiss b/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.faiss new file mode 100644 index 0000000..5c2a80b Binary files /dev/null and b/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.faiss differ diff --git a/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.pkl b/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.pkl new file mode 100644 index 0000000..1e1ba16 Binary files /dev/null and b/knowledge_base/e9e61b56-69ee-4420-bb03-9841620560fa/vector_store/FAISS/index.pkl differ diff --git a/Similarity_calculation_tool/qa_Ask.py b/qa_Ask.py similarity index 98% rename from Similarity_calculation_tool/qa_Ask.py rename to qa_Ask.py index 9cf3479..b89bb10 100644 --- a/Similarity_calculation_tool/qa_Ask.py +++ b/qa_Ask.py @@ -51,7 +51,7 @@ def load_testing_data(file_path): with open(file_path, encoding='utf-8') as f: data = json.load(f) for item in data: - question_code = item['questionCode'] + question_code = item['questionId'] question_list.extend(item['questionList']) id_list.extend([create_question_id(question_code, j, q) for j, q in enumerate(item['questionList'])]) diff --git a/Similarity_calculation_tool/requirements.txt b/requirements.txt similarity index 100% rename from Similarity_calculation_tool/requirements.txt rename to requirements.txt