mdsearch is a python package for paper search
Project description
代码调用
整体流程为通过search_info封装用户的查询内容,然后调用相关API返回检索结果。
- 初始化
from mdsearch import Searcher
S = Searcher(index_name='paperdb', doc_type='papers')
- 检索论文
paper, paper_id, paper_num = S.search_paper_by_name(search_info)
返回结果说明:
paper_num : A int number of paper.
paper_id : A list of string, each string means paper id.
paper : A list of dicts, each dict stores information of a paper.
- 检索单个论文视频中的相关内容(可通过前一步检索论文返回的paper_id或者paper,注意是单个)
video_pos = S.get_video_pos_by_paper_id(search_info, paper_id)
video_pos = S.get_video_pos_by_paper(search_info, paper)
- search_info 格式
# 综合检索
search_info = {
'query_type': 'integrated_search',
'query': string, # 用户查询的内容
'match': {
'title': bool, # True/False表示是否检索这个字段的内容
'abstract': bool,
'paperContent': bool,
'videoContent': bool,
},
'filter': {
'yearfrom': 1000, # paper的年份限制
'yearbefore': 3000,
},
# 'sort': 'relevance',
'sort': 'year', # 排序方式:year/cited/relevance
'is_filter': False, # 是否先过滤后排序,建议True,提升检索效率
'is_rescore': False, # 是否采用重排序,依据relevance排序时建议True,增强排序效果
'is_cited': False # 是否使用引用量参与排序,由于未爬取引用量字段,只能为False
}
# 高级检索
search_info_2 = {
'query_type': 'advanced_search',
'match': {
'title': string, # 用户查询内容
'abstract': string, # 若不含有某项,设置成 None/False
'paperContent': string,
'videoContent': string,
},
'filter': {
'yearfrom': 1000,
'yearbefore': 3000,
},
'sort': 'year',
'is_filter': False, # 高级检索无论True还是False都不会进行过滤
'is_rescore': False,
'is_cited': False
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mdsearch-0.0.8.tar.gz
(7.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdsearch-0.0.8.tar.gz.
File metadata
- Download URL: mdsearch-0.0.8.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cca04402590d5e0f63e4c322e5aeec9dfef8d04573c96e202a7b2e95c468dcc
|
|
| MD5 |
72b904996dc73b277e59b38fae1b1444
|
|
| BLAKE2b-256 |
ef4e6b3322cd3ecf0b56dc6244cb3c39488f90ec20f92e7278184e83f349c8ba
|
File details
Details for the file mdsearch-0.0.8-py3-none-any.whl.
File metadata
- Download URL: mdsearch-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f9555c8bc7a33db6a464d88a12d83336f6d490d6fc7e16a08ceaabf98420d90
|
|
| MD5 |
238c4b1fcb3bb46ba9286d4f17baec3f
|
|
| BLAKE2b-256 |
7bd88164e1c84a3a93d348b258a4ad6ddcdebac1c398ffc284f85c1b70308286
|