Skip to content

Commit 0a52edd

Browse files
committed
update
1 parent 836ca84 commit 0a52edd

3 files changed

Lines changed: 15 additions & 21 deletions

File tree

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,6 @@ all-in-rag/
158158
- 📚 **文档改进**:帮助完善文档内容和示例代码
159159
-**代码贡献**:提交 [Pull Request](https://github.com/datawhalechina/all-in-rag/pulls) 改进项目
160160

161-
### 贡献指南
162-
1. Fork 本仓库
163-
2. 创建你的特性分支 (`git checkout -b feature/AmazingFeature`)
164-
3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)
165-
4. 推送到分支 (`git push origin feature/AmazingFeature`)
166-
5. 打开一个 Pull Request
167-
168161
## Star History
169162

170163
[![Star History Chart](https://api.star-history.com/svg?repos=datawhalechina/all-in-rag&type=Date)](https://star-history.com/#datawhalechina/all-in-rag&Date)

code/C4/01_hybrid_search.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@
7171
docs, metadata = [], []
7272
for item in dataset:
7373
parts = [
74-
item.get('title', ''), item.get('description', ''),
75-
*item.get('combat_details', {}).get('combat_style', []),
76-
*item.get('combat_details', {}).get('abilities_used', []),
77-
item.get('scene_info', {}).get('location', ''),
78-
item.get('scene_info', {}).get('environment', ''),
79-
item.get('scene_info', {}).get('time_of_day', '')
74+
item.get('title', ''),
75+
item.get('description', ''),
76+
item.get('location', ''),
77+
item.get('environment', ''),
78+
# *item.get('combat_details', {}).get('combat_style', []),
79+
# *item.get('combat_details', {}).get('abilities_used', []),
80+
# item.get('scene_info', {}).get('time_of_day', '')
8081
]
8182
docs.append(' '.join(filter(None, parts)))
8283
metadata.append(item)
@@ -145,8 +146,6 @@
145146
density = (sparse_vec.nnz / sparse_vec.shape[1] * 100)
146147
print(f"\n稀疏向量密度: {density:.8f}%")
147148

148-
# 定义搜索参数
149-
150149
# 定义搜索参数
151150
search_params = {"metric_type": "IP", "params": {}}
152151

code/C4/01_hybrid_search_v2.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@ def __call__(self, texts):
174174
docs, metadata = [], []
175175
for item in dataset:
176176
parts = [
177-
item.get('title', ''), item.get('description', ''),
178-
*item.get('combat_details', {}).get('combat_style', []),
179-
*item.get('combat_details', {}).get('abilities_used', []),
180-
item.get('scene_info', {}).get('location', ''),
181-
item.get('scene_info', {}).get('environment', ''),
182-
item.get('scene_info', {}).get('time_of_day', '')
177+
item.get('title', ''),
178+
item.get('description', ''),
179+
item.get('location', ''),
180+
item.get('environment', ''),
181+
# 以下字段在当前数据中不存在,已注释
182+
# *item.get('combat_details', {}).get('combat_style', []),
183+
# *item.get('combat_details', {}).get('abilities_used', []),
184+
# item.get('scene_info', {}).get('time_of_day', '')
183185
]
184186
docs.append(' '.join(filter(None, parts)))
185187
metadata.append(item)

0 commit comments

Comments
 (0)