CoolFace
Datasetpublic

frederickwang99/SoAyBench

SoAyBench by WangYC We've based SoAyBench creation on AMiner. To really understand how well LLMs can use SoAPI, we need to make AMiner's basic SoAPIs available for LLMs to use. We also need a test set made up of academic (question, solution, answer) triplets for checking how they're doing. The tricky part is, academic data keeps changing fast – stuff like info on scholars and their publications. So, keeping a test set with fixed answers is tough. To tackle this, what we've… See the full description on the dataset page: https://huggingface.co/datasets/frederickwang99/SoAyBench.

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes409downloads
Dataset Card

SoAyBench

by WangYC

We've based SoAyBench creation on AMiner. To really understand how well LLMs can use SoAPI, we need to make AMiner's basic SoAPIs available for LLMs to use. We also need a test set made up of academic (question, solution, answer) triplets for checking how they're doing. The tricky part is, academic data keeps changing fast – stuff like info on scholars and their publications. So, keeping a test set with fixed answers is tough.

To tackle this, what we've done is clone AMiner's SoAPIs as they were at a certain moment (Sep 15th 2023). This way, we've got a static version of the service. From there, we create a matching test set that doesn't change.

[toc]

Dataset Overview

You can find 44 jsonl files in SoAyBench.

Each of the jsonl file contains 18 lines.

Each line is a query-answer data like :

json
{
   "Query": "Query in Chinese", 
   "Query_en": "Query in English", 
   "Answer": "Answer to the Query", 
   "Base_Question_zh": "Template query in Chinese", 
   "Base_Question_en": "Template query in English", 
   "Inputs": "Information which serves as the inputs of the APIs", 
   "Outputs": "The key of the answer at the API's response", 
   "Entity_Information": "Information that is filled into the template query"
}

For example:

json
{
    "Query": "Mutual Information领域的Jean Barbier的代表作的pdf链接是?", 
    "Query_en": "What is the PDF link of the representative work of Jean Barbier in Mutual Information field?", 
    "Answer": "//static.aminer.cn/misc/pdf/NIPS/2018/5b3d98cc17c44a510f801b5c.pdf", "Base_Question_zh": "XX领域的XXX的代表作的pdf链接是?", 
    "Base_Question_en": "What is the PDF link of the representative work of XXX in XX field?", 
    "Inputs": "name, interest", 
    "Outputs": "pdf_link", 
    "Entity_Information": 
      {
         "name": "Jean Barbier", 
         "organization": "International Centre for Theoretical Physics", 
         "interest": "Mutual Information"
      }
}

How to use AMiner APIs that is included in SoAyBench?

In addition to providing a substantial amount of QA data, SoAyBench also includes a set of SoAPI services, encompassing a total of 7 APIs from AMiner. SoAy has filtered and wrapped the input and output of the original APIs into 7 functions.

You can find this details in https://github.com/RUCKBReasoning/SoAy/model.py

You can try all these APIs with SoAy/api_test.py

python
class aminer_soay:
    def __init__(self):
        self.addr = 'https://soay.aminer.cn/'
    
    def searchPersonComp(self, **kwargs):
        personList = []
        addr = self.addr + 'searchPerson'
        headers = {
            'Content-Type' : 'application/json'
        }
        searchKeyWordList = []
        if 'name' in kwargs:
            searchKeyWordList.append({
                        "operate": "0",
                        "wordType": 4,
                        "keyword": kwargs['name'],
                        "advanced": True,
                        "needTranslate": True
                    })
        if 'interest' in kwargs:
            searchKeyWordList.append({
                        "operate": "0",
                        "wordType": 2,
                        "keyword": kwargs['interest'],
                        "advanced": True,
                        "needTranslate": True
                    })
        if 'organization' in kwargs:
            searchKeyWordList.append({
                        "operate": "0",
                        "wordType": 5,
                        "keyword": kwargs['organization'],
                        "advanced": True,
                        "needTranslate": True
                    })
        json_content = json.dumps({
            "sort": [{'asc': False, 'field' : 'n_citation'}],
            "searchKeyWordList": searchKeyWordList,
            "needDetails" : True
        })
        response = requests.post(
            url=addr,
            headers = headers,
            data = json_content
        )
        result = response.json()
        for each in result['data']['hitList']:
            # print(each)
            try:
                personList.append(
                    {
                        'person_id' : each['id'],
                        'name' : each['name'],
                        'interests' : [each['interests'][i]['t'] for i in range(min(len(each['interests']), 10))],
                        # 'nation': each['nation'], 
                        'num_citation' : each['ncitation'],
                        'num_pubs': each['npubs'],
                        'organization' : each['contact']['affiliation']
                    }
                )
            except:
                continue
        return personList
    
    def searchPublication(self, publication_info):
        addr = self.addr + 'searchPublication'
        pubList = []
        headers = {
            'Content-Type' : 'application/json'
        }
        json_content = json.dumps({
            "query" : publication_info,
            'needDetails' : True,
            'page' : 0,
            'size' : 10,
            "sort": [{'asc': False, 'field' : 'n_citation'}],
        })
        response = requests.post(
            url=addr,
            headers = headers,
            data = json_content
        )
        result = response.json()
        for each in result['data']['hitList']:
            try:
                pubList.append({
                    'pub_id' : each['id'],
                    'title' : each['title'],
                    'year' : each['year']
                })
            except:
                continue

        return pubList

    def getPublication(self, pub_id):
        addr = self.addr + 'getPublication'
        addr = wrapUrlParameter(addr, id = pub_id)
        # addr = addr + '?AppCode=' + self.appcode + '&id=' + id
        response = requests.get(url = addr)
        result = response.json()['data'][0]['pub']
        info_dict = {}
        try:
            info_dict['abstract'] = result['abstract']
        except:
            info_dict['abstract'] = 'paper abstract'
        author_list = []
        for each in result['authors']:
            try:
                author_list.append({'person_id' : each['id'], 'name' : each['name']})
            except:
                continue
        if author_list != []:
            info_dict['author_list'] = author_list
        try:
            info_dict['num_citation'] = result['num_citation']
        except:
            pass
        try:
            info_dict['year'] = result['year']
        except:
            pass
        try:
            info_dict['pdf_link'] = result['pdf']
        except:
            pass
        try:
            info_dict['venue'] = result['venue']
        except:
            pass
        return info_dict
    
    def getPersonInterest(self, person_id):
        addr = self.addr + 'getPersonInterest'
        addr = wrapUrlParameter(addr, id = person_id)
        # addr = addr + '?AppCode=' + self.appcode + '&id=' + id
        response = requests.get(url = addr)
        try:
            result = response.json()['data'][0]['data']['data']['data']
        except:
            return []
        interest_list = [result[i]['t'] for i in range(len(result))]
        return interest_list

    def getCoauthors(self, person_id):
        addr = self.addr + 'getCoauthors'
        addr = wrapUrlParameter(addr, id = person_id)
        response = requests.get(url=addr)
        result = response.json()['data'][0]['data']['crs']
        coauthorsList = []
        for each in result:
            try:
                coauthorsList.append({
                    'person_id' : each['id'],
                    'name' : each['name'],
                    'relation' : each['relation']
                })
            except:
                continue
        # coauthorsList = [{'person_id' : result[i]['id'], 'relation' : result[i]['relation']} for i in range(min(len(result), 10))]
        return coauthorsList
    
    def getPersonPubs(self, person_id):
        addr = self.addr + 'getPersonPubs'
        addr = wrapUrlParameter(addr, id = person_id, offset = 0, size = 10, order = 'citation')
        response = requests.get(url=addr)
        result = response.json()['data'][0]['data']['pubs']
        pub_list = []
        for each in result:
            try:
                pub_list.append({
                    # 'abstract' : result[i]['abstract'],
                    'pub_id' : each['id'],
                    'title' : each['title'],
                    'num_citation' : each['ncitation'],
                    'year' : each['year'],
                    'authors_name_list' : [each['authors'][j]['name']for j in range(len(each['authors']))]
                })
            except:
                continue
        return pub_list
    
    def getPersonBasicInfo(self, person_id):
        addr = self.addr + 'getPersonBasicInfo'
        addr = wrapUrlParameter(addr, id = person_id)

        response = requests.get(url=addr)
        result = response.json()['data'][0]['data']
        # print(response)
        info_dic = {
                    'person_id' : person_id,
                    'name' : result['name'],
                    'gender' : result['gender'],
                    'organization' : result['aff'],
                    'position' : result['position'],
                    'bio' : result['bio'],
                    'education_experience' : result['edu'],
                    'email' : result['email']
                    # 'ncitation' : result['num_citation']
                }
        return info_dic

Original Service

We list all the original AMiner APIs below, which you can use to create new applications.

searchPerson

Information

Path: /soay.aminer.cn/searchPerson

Method: POST

Description:

Examples: 1.Basic Searching

{
    "query": "jiawei han",
    "needDetails": true,
    "page": 0,
    "size": 10
}

2.Complecated Searching

{
    "searchKeyWordList": [
        {
            "operate": "0",
            "wordType": 5,
            "keyword": "University of Illinois at Urbanan",
            "advanced": true
        },
        {
            "operate": "0",
            "wordType": 4,
            "keyword": "jiawei han",
            "advanced": true
        }
    ],
    "filters": [
        {
            "boolOperator": "3",
            "type": "term",
            "field": "gender",
            "value": "male"
        }
    ],
    "page": 0,
    "size": 10,
    "needDetails": true,
    "aggregations": [
        {
            "field": "gender",
            "type": "terms",
            "size": 2
        },
        {
            "field": "nation",
            "type": "terms",
            "size": 10
        },
        {
            "field": "lang",
            "type": "terms",
            "size": 10
        },
        {
            "field": "h_index",
            "type": "range",
            "rangeList": [
                {
                    "from": 0,
                    "to": 10
                },
                {
                    "from": 11,
                    "to": 20
                },
                {
                    "from": 21,
                    "to": 30
                },
                {
                    "from": 31,
                    "to": 40
                },
                {
                    "from": 41,
                    "to": 50
                },
                {
                    "from": 51,
                    "to": 60
                },
                {
                    "from": 61,
                    "to": 99999
                }
            ],
            "size": 1
        }
    ]
}
Parameters

Headers

NameValueNecessaryExampleNote
Content-Typeapplication/jsonY

Body

NameTypeNecessaryDefaultNoteOthers
aggregationsobject []N聚合配置item type: object
├─ fieldstringN属性: h_index-h指数; lang-语言; nation-国家和地区; gender-性别;
├─ orderobjectN聚合排序参数(termstype,filed不为key及count时为要排序的子聚合的路径)
├─ ascbooleanY升序排序
├─ fieldstringY字段
├─ rangeListobject []N分段列表(rangtype)item type: object
├─ fromnumberN起始,gte
├─ tonumberN截止,lte
├─ sizenumberN聚合结果大小(termstype)
├─ subAggregationListobject []N子聚合参数列表item type: object
├─ typestringNtype(terms,range,max,min,avg)
filtersobject []N过滤配置item type: object
├─ boolOperatornumberNbool操作type: 0-must;(参与分数计算,如无特殊需求,不推荐使用) 1-should; 2-mustNot; 3-filter;(不参与分数计算,推荐)
├─ fieldstringN过滤字段: h_index-h指数; lang-语言; nation-国家和地区; gender-性别;
├─ rangeOperatorstringN判断符(rangetype使用:gt-大于;gte-大于等于;lt-小于;lte-小于等于;eq-等于)
├─ typestringNtype: term-关键词过滤; terms-多关键词过滤; range-数值范围过滤;
├─ valueobjectN过滤值
├─ valueListstring []N多关键词过滤列表(termstype使用)item type: string
├─N
needDetailsbooleanN查询属性
pagenumberN分页(起始页为0)
querystringN通用查询词
searchKeyWordListobject []N高级搜索词列表item type: object
├─ advancedbooleanN是否高级搜索
├─ fieldMapobjectN字段映射及字段权重(如无特殊需求,参数请勿添加此字段)
├─ keywordstringY关键词
├─ languagenumberN词语言(如无特殊需求,参数请勿添加此字段)
├─ needTranslatebooleanN是否翻译(非必填,默认为false)
├─ operatenumberY搜索运算type: 0-并且; 1-或者; 2-且非;
├─ segmentationWordbooleanN是否分词(非必填,默认为false)
├─ userInputbooleanN是否用户输入(非必填,默认为true)
├─ weightnumberN词权重(如无特殊需求,参数请勿添加此字段)
├─ wordTypenumberY词type: 0-术语; 4-作者; 5-组织;
sizenumberY页长(最小为1)
sortobject []N排序item type: object
├─ ascbooleanY升序排序
├─ fieldstringY字段: hindex-h指数; activity-学术活跃度; risingstar-领域新星; ncitation-引用数; npubs-论文数;
Return
nametypenecessarydefaultnotesOther Information
codenumberY错误码
successbooleanY接口成功信息
dataobjectYReturn
├─ hitListobject []N命中列表item type: object
├─ idstringYid
├─ namestringN英文姓名
├─ nameZhstringN中文姓名
├─ genderstringN性别
├─ orgstringN组织
├─ orgZhstringN中文组织
├─ interestsstring []N研究兴趣item type: string
├─N
├─ avatarstringN头像
├─ languagestringN语言( "chinese" "english" "french" "german" "greek" "japanese" "unknown" "korean" "indian" "hindi" "italian" "spanish" "dutch" "russian" "swedish" "arabic" "portuguese" "hebrew" "bengali" "turkish")
├─ locationstringN
├─ nationstringN国家或地区
├─ activitynumberN
├─ contactobjectN人为标注信息
├─ gindexnumberN
├─ hindexnumberN
├─ npubsnumberN论文数
├─ ncitationnumberN引用数
├─ hitsTotalnumberN命中数
├─ aggregationMapobjectN聚合信息
msgstringY接口成功说明

searchPublication

Information

Path: /soay.aminer.cn/searchPublication

Method: POST

Description:

Examples: 1.Basic Searching

{
    "query": "data mining",
    "needDetails": true,
    "page": 0,
    "size": 10
}

2.Complecated Searching

{
    "needDetails": true,
    "page": 0,
    "size": 20,
    "aggregations": [
        {
            "field": "keywords.keyword",
            "size": 20,
            "type": "terms"
        },
        {
            "field": "authors.orgid",
            "size": 20,
            "type": "terms"
        },
        {
            "field": "year",
            "size": 100,
            "type": "terms"
        }
    ],
    "filters": [
        {
            "boolOperator": 3,
            "type": "term",
            "value": "data structure",
            "field": "keywords.keyword"
        }
    ],
    "searchKeyWordList": [
        {
            "advanced": true,
            "keyword": "jiawei han",
            "operate": "0",
            "wordType": 4
        },
        {
            "advanced": true,
            "keyword": "Mining frequent patterns without candidate generation",
            "operate": "0",
            "wordType": 1
        }
    ]
}
Parameters

Headers

name参数值necessaryexamplesnotes
Content-Typeapplication/jsonY

Body

nametypenecessarydefaultnotesOther Information
aggregationsobject []N聚合配置item type: object
├─ fieldstringN属性: keywords.keyword-关键词; authors.orgid-作者机构id; year-发表年份;
├─ orderobjectN聚合排序参数(termstype,filed不为key及count时为要排序的子聚合的路径)
├─ ascbooleanY升序排序
├─ fieldstringY字段
├─ rangeListobject []N分段列表(rangtype)item type: object
├─ fromnumberN起始,gte
├─ tonumberN截止,lte
├─ sizenumberN聚合结果大小(termstype)
├─ subAggregationListobject []N子聚合参数列表item type: object
├─ typestringNtype(terms,range,max,min,avg)
filtersobject []N过滤配置item type: object
├─ boolOperatornumberNbool操作type: 0-must;(参与分数计算,且与should互斥,如无特殊需求,不推荐使用) 1-should; 2-mustNot; 3-filter;(不参与分数计算,推荐)
├─ fieldstringN过滤字段: keywords.keyword-关键词; authors.orgid-作者机构id; year-发表年份;
├─ rangeOperatorstringN判断符(rangetype使用:gt-大于;gte-大于等于;lt-小于;lte-小于等于;eq-等于)
├─ typestringNtype: term-关键词过滤; terms-多关键词过滤; range-数值范围过滤;
├─ valueobjectN过滤值
├─ valueListstring []N多关键词过滤列表(termstype使用)item type: string
├─N
needDetailsbooleanN查询属性
pagenumberY分页(起始页为0)
querystringN通用查询词
searchKeyWordListobject []N高级搜索词列表item type: object
├─ advancedbooleanN是否高级搜索
├─ fieldMapobjectN字段映射及字段权重(如无特殊需求,参数请勿添加此字段)
├─ keywordstringY关键词
├─ languagenumberN词语言(如无特殊需求,参数请勿添加此字段)
├─ needTranslatebooleanN是否翻译(非必填,默认为false)
├─ operatenumberY搜索运算type: 0-并且; 1-或者; 2-且非;
├─ segmentationWordbooleanN是否分词(非必填,默认为false)
├─ userInputbooleanN是否用户输入(非必填,默认为true)
├─ weightnumberN词权重(如无特殊需求,参数请勿添加此字段)
├─ wordTypenumberY词type: 0-术语; 1-标题; 2-关键词; 3-摘要; 4-作者; 5-组织; 6-期刊;
sizenumberY页长(最小为1)
sortobject []N排序item type: object
├─ ascbooleanY升序排序
├─ fieldstringY字段: year-发表年份; n_citation-引用数;
Return
nametypenecessarydefaultnotesOther Information
codenumberY错误码
successbooleanY接口成功信息
dataobjectYReturn
├─ hitListobject []N结果列表item type: object
├─ idstringY
├─ titlestringN论文标题
├─ titleZhstringN中文标题
├─ authorsstring []N作者item type: string
├─N
├─ languagestringN语言
├─ yearnumberN发表年份
├─ pdfstringN
├─ doistringN
├─ issnstringN
├─ isbnstringN
├─ pubAbstractstringN摘要
├─ pubAbstractZhstringN中文摘要
├─ urlstring []Nitem type: string
├─N
├─ keywordsstring []N关键词item type: string
├─N
├─ keywordsZhstring []N中文关键词item type: string
├─N
├─ venueobjectN期刊
├─ _idstringN期刊id
├─ rawstringN期刊name
├─ pageStartstringN起始页
├─ pageEndstringN截止页
├─ pageStringstringN起始页截止页字符串表示
├─ volumestringN期刊卷册号
├─ createDatestringN
├─ ncitationnumberN引用量
├─ hitsTotalnumberN命中数量
├─ aggregationMapobjectN聚合信息
msgstringY接口成功信息

getPublication

Information

Path: /soay.aminer.cn/getPublication

Method: GET

Description:

Parameters

Query

namenecessaryexamplesnotes
id
Return
nametypenecessarydefaultnotesOther Information
dataobject []Nitem type: object
├─ cited_pubsobjectN
├─ totalnumberN
├─ metaobjectN
├─ contextstringN
├─ timestringN
├─ timesobject []Nitem type: object
├─ dnumberN
├─ nstringN
├─ sstringN
├─ pubobjectN
├─ abstractstringN摘要
├─ authorsobject []N作者列表item type: object
├─ namestringY作者姓名
├─ idstringN作者id
├─ orgstringN作者机构
├─ orgidstringN机构id
├─ orgsstring []Nitem type: string
├─N
├─ create_timestringN
├─ doistringN
├─ hashsobjectN
├─ h1stringN
├─ h3stringN
├─ idstringY
├─ issnstringN
├─ keywordsstring []N关键词item type: string
├─N
├─ langstringN语言
├─ num_citationnumberN引用量
├─ pagesobjectN发表期刊所在页码
├─ endstringN
├─ startstringN
├─ titlestringY论文标题
├─ pdfstringNpdf文件链接
├─ update_timesobjectN
├─ uvtstringN
├─ uatstringN
├─ uctstringN创建时间
├─ urlsstring []N原文urlitem type: string
├─N
├─ venueobjectN期刊信息(未对齐实体信息)
├─ infoobjectN
├─ namestringN
├─ issuestringN
├─ volumestringN
├─ venuehhbidstringN期刊id
├─ versionsobject []N合并版本信息item type: object
├─ idstringN
├─ sidstringN
├─ srcstringN
├─ vsidstringN
├─ yearnumberN
├─ yearnumberN发表年份
├─ succeedbooleanN
├─ total_refnumberN
├─ total_simnumberN

getPersonBasicInfo

Information

Path: /soay.aminer.cn/getPersonBasicInfo

Method: GET

Description:

学者个人基础信息

Parameters

Query

namenecessaryexamplesnotes
idY学者ID
Return
nametypenecessarydefaultnotesOther Information
dataobject []Nitem type: object
├─ dataobjectN
├─ affstringN机构
├─ aff_detailsobjectN机构信息
├─ idstringN机构ID
├─ name_enstringN机构英文name
├─ name_zhstringN机构中文name
├─ aff_zhstringN机构(中文)
├─ biostringN个人简介
├─ edustringN教育经历
├─ emailstringN邮箱
├─ firstpapertimenumberN第一篇论文时间
├─ genderstringN性别
├─ geo_infoobjectN流动信息
├─ administrative_divisionobjectN
├─ countrystringN
├─ en0stringN
├─ en1stringN
├─ en2stringN
├─ formatted_addressstringN
├─ geoobjectN
├─ latnumberN
├─ lngnumberN
├─ idstringN
├─ namestringN
├─ org_idstringN
├─ homepagestringN个人主页
├─ idstringN
├─ labelsstring []N标签item type: string
├─N
├─ languagestringN语言
├─ linksobjectN个人主页链接
├─ gsobjectNGoogleScholar个人主页
├─ creatorstringN标注人员
├─ idstringN
├─ typestringN连接type
├─ urlstringN个人主页url
├─ resourceobjectN
├─ resource_linkobject []N个人主页链接item type: object
├─ idstringN连接type:hp(个人主页),dblp(dblp主页)
├─ urlstringN主页连接
├─ namestringN姓名
├─ name_zhstringN中文姓名
├─ positionstringN职称
├─ position_zhstringN职称(中文)
├─ work_detailsobjectN工作经历
├─ idstringN
├─ name_enstringN
├─ name_zhstringN
├─ worksstringN工作经历
├─ metaobjectN
├─ contextstringN
├─ timestringN
├─ succeedbooleanN

getPersonlnterest

Information

Path: /soay.aminer.cn/getPersonlnterest

Method: GET

Parameters

Query

namenecessaryexamplesnotes
idY53f46a3edabfaee43ed05f08学者id
is_yearNtrue按年份分组
Return
nametypenecessarydefaultnotesOther Information
dataobject []Nitem type: object
├─ dataobjectN
├─ dataobjectN
├─ dataobject []Nitem type: object
├─ nnumberY兴趣程度
├─ tstringY领域关键词
├─ yeararray []Y年份item type: array
├─N
├─N
├─ editedbooleanN
├─ numnumberN
├─ succeedbooleanN
├─ metaobjectN
├─ contextstringN
├─ timestringN
├─ succeedbooleanN

getCoauthors

Information

Path: /soay.aminer.cn/getCoauthors

Method: GET

Description:

学者网络关系

Parameters

Query

namenecessaryexamplesnotes
id学者ID
Return
nametypenecessarydefaultnotesOther Information
dataobject []Nitem type: object
├─ dataobjectN
├─ crsobject []N关联学者列表item type: object
├─ idstringY
├─ namestringY姓名
├─ relationstringY学者关系
├─ wnumberY关系紧密度
├─ idstringN
├─ namestringN学者姓名
├─ name_zhstringN学者姓名(中文)
├─ metaobjectN
├─ contextstringN
├─ timestringN
├─ succeedbooleanN

getPersonPubs

Information

Path: /soay.aminer.cn/getPersonPubs

Method: GET

Description:

学者论文信息

Parameters

Query

namenecessaryexamplesnotes
idY学者id
offsetY偏移量
sizeY每次获取条目数量
orderNcitation排序方式,支持year和citation,未传默认为year,
Return
nametypenecessarydefaultnotesOther Information
dataobject []Nitem type: object
├─ dataobjectN
├─ gindexnumberNg-index
├─ hindexnumberNh-index
├─ idstringN
├─ namestringN姓名
├─ name_zhstringN姓名(中文)
├─ ncitationnumberN论文引用量
├─ npubsnumberN论文数
├─ pubsobject []N论文列表item type: object
├─ abstractstringY摘要
├─ idstringY
├─ linkstring []Yitem type: string
├─N
├─ ncitationnumberY引用量
├─ titlestringY标题
├─ venuestringY期刊
├─ yearnumberY年份
├─ source_linkobject []Yitem type: object
├─ descstringY
├─ linkstringY
├─ peekstringY
├─ metaobjectN
├─ contextstringN
├─ timestringN
├─ succeedbooleanN