我如何使用Mathematica和谷歌学者来查找一个人在2011年发表的论文数量?
发布于 2011-05-25 00:40:02
谷歌学者并不是很适合这个目标,因为它没有正式的API AFAIK。它也不提供结构化(例如XML)格式的结果。所以,我们不得不求助于一个快速的(非常,非常脆弱的!)文本模式匹配类似于:
searchGoogleScholarAuthor[author_String] :=
First[StringCases[
Import["http://scholar.google.com/scholar?start=0&num=1&q=" <>
StringDrop[
StringJoin @@ ("author:" <> # <> "+" & /@
StringSplit[author]), -1] <> "&hl=en&as_sdt=1,5"], ___ ~~
"Results" ~~ ___ ~~ "of about" ~~ Shortest[___] ~~
p : Longest[(DigitCharacter | ",") ..] ~~ ___ ~~ "." ~~ ___ ~~
"(" ~~ ___ :> p]]
In[191]:= searchGoogleScholarAuthor["A Einstein"]
Out[191]= "6,400"
In[190]:= searchGoogleScholarAuthor["Einstein"]
Out[190]= "9,400"
In[192]:= searchGoogleScholarAuthor["Wizard"]
Out[192]= "197"
In[193]:= searchGoogleScholarAuthor["Vries"]
Out[193]= "70,700"如果您不喜欢字符串结果,则添加ToExpression。如果要限制发布年份,可以将&as_ylo=2011&as_yhi=2011&添加到搜索字符串中,并相应地更改起始年份和结束年份。
请注意,具有流行名称的作者将生成许多虚假的命中,因为没有方法唯一地识别单个作者。此外,学者返回各种各样的点击,包括引用,书籍,重印和更多。所以,真的,这对计数并不是很有用。
稍微解释一下:
Scholar将作者和合著者的首字母和姓名拆分在几个author:字段中,并使用+。代码的StringDrop[StringJoin @@ ("author:" <> # <> "+" & /@ StringSplit[author]), -1]部分负责这一点。StringDrop删除最后一个+。
Stringcases部件包含一个很大的文本模式,它主要搜索学者放置在每个结果页面顶部的文本,其中包含命中的数量。然后隔离并返回此数字。
https://stackoverflow.com/questions/6109520
复制相似问题