Skip to main content

mdsearch is a python package for paper search

Project description

代码调用

整体流程为通过search_info封装用户的查询内容,然后调用相关API返回检索结果。

  1. 初始化
from mdsearch import Searcher
S = Searcher(index_name='paperdb', doc_type='papers')
  1. 检索论文
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.
  1. 检索单个论文视频中的相关内容(可通过前一步检索论文返回的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)
  1. 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


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.7.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdsearch-0.0.7-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file mdsearch-0.0.7.tar.gz.

File metadata

  • Download URL: mdsearch-0.0.7.tar.gz
  • Upload date:
  • Size: 6.8 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

Hashes for mdsearch-0.0.7.tar.gz
Algorithm Hash digest
SHA256 66b339eb72f6a221e05935032299dc3ef3fe604aa4ec3b9670e9566c369f35b1
MD5 9eee2e149b2056596b65f65449874776
BLAKE2b-256 9aa5b8d3211316f71d2c2f7e54328d04ce20b9196e508cda8ae5efd42f1e5921

See more details on using hashes here.

File details

Details for the file mdsearch-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: mdsearch-0.0.7-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

Hashes for mdsearch-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 60db1bb1cd9975cce48187290cfff44fedd392a91235b8bf445a971ea2e5eda3
MD5 c84be27016b2f5831f8b75d7c1e538a5
BLAKE2b-256 ef3ec65984d91cb199db7d6c3ecba11a08ce421336c23c07bf135882a66d25de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page