可视化展示——查询论文
程序员文章站
2022-03-22 20:22:11
...
实现输入论文名,查询论文的相关信息:
代码:
views.py文件:
def choose_detail(request):
node= request.POST['node']
artical=""
author=""
abstract=""
affiliation=""
IndexTerm=""
keyword=""
inlink=""
outlink=""
GeneralTerm=""
num=0
kk=""
with open('choose_paper/data/nodes2.txt','r',encoding='utf-8') as f:
line=f.readlines()
for j in range(len(line)):
line=line[j].split()
node_sp=node.split()
flag=False
if(len(node_sp)==(len(line)-1)):
for i in range(len(node_sp)):
if(node_sp[i]!=line[i+1]):
flag=False
break
else:
flag=True
if flag==True:
artical=line[0]
num=j
break
with open('choose_paper/data/abstracts.txt','r',encoding='utf-8') as f:
lines=f.readlines()
abstract=lines[num]
with open('choose_paper/data/affiliations.txt','r',encoding='utf-8') as f:
lines=f.readlines()
affiliation=lines[num]
with open('choose_paper/data/articles.txt','r',encoding='utf-8') as f:
lines=f.readlines()
artical=lines[num]
with open('choose_paper/data/authors.txt','r',encoding='utf-8') as f:
lines=f.readlines()
author=lines[num]
with open('choose_paper/data/GeneralTerms.txt','r',encoding='utf-8') as f:
lines=f.readlines()
GeneralTerm=lines[num]
with open('choose_paper/data/IndexTerms.txt','r',encoding='utf-8') as f:
lines=f.readlines()
IndexTerm=lines[num]
with open('choose_paper/data/inlinks_nodes.txt','r',encoding='utf-8') as f:
lines=f.readlines()
inlink=lines[num]
with open('choose_paper/data/keywords.txt','r',encoding='utf-8') as f:
lines=f.readlines()
keyword=lines[num]
with open('choose_paper/data/outlinks_nodes.txt','r',encoding='utf-8') as f:
lines=f.readlines()
outlink=lines[num]
# kk=abstract
context = {
'articals': artical,
'authors ': author,
'abstracts': abstract,
'affiliations': affiliation,
'IndexTerms ': IndexTerm,
'keywords': keyword,
'nodes': node,
'inlinks': inlink,
'outlinks':outlink,
'GeneralTerms': GeneralTerm,
}
return render(request, 'choose_paper/paper_detail.html', context)
数据处理(论文id/论文year/论文venue 形式):
代码:
#用来生成id year venue 文件
with open('./articles.txt', 'r', encoding='utf-8') as f1:
with open('./years.txt', 'r', encoding='utf-8') as f2:
with open('./venues.txt', 'r', encoding="ISO-8859-1") as f3:
ids=f1.readlines()
years=f2.readlines()
venues=f3.readlines()
with open('./id_year_venue.txt', 'a', encoding='utf-8') as f4:
for i in range(len(ids)):
f4.write(ids[i])
f4.write(years[i])
f4.write(venues[i])
f4.write("\n")
获取满足条件的(年份&会议)的论文集合(id):
简单的输出:
代码:
if 'paper_set' in request.POST:
year = request.POST['datetimepicker']
venue = request.POST['venue']
articals=""
with open("choose_paper/data/id_year_venue.txt",'r',encoding='utf-8') as f:
lines=f.readlines()
i=0
while i< len(lines)-3:
a=lines[i].strip()
b=lines[i+1].strip()
c=lines[i+2].strip()
if(b==year and c==venue):
articals+=a
articals+=" "
i+=4
context = {
'articles':articals#获取满足年份,会议的论文id
}
上述内容详见:
https://blog.csdn.net/qq_41798302/article/details/106744591
https://blog.csdn.net/qq_41798302/article/details/106819799
上一篇: 字符设备驱动框架代码的编写
下一篇: 可视化展示——论文相似度分析页面设计
推荐阅读
-
QingTing.Fm-WPF是调用蜻蜓FMAPI 查询API内容展示,进行播放
-
python tushare Tkinter构建股票可视化查询系统(Beta v0.1)
-
python数据可视化 – 利用Bokeh和Bottle.py在网页上展示你的数据
-
Django使用echarts进行可视化展示(mysql数据库)
-
spring boot新闻管理条件查询分页展示+新增+编辑
-
sqlite查询结果在listview中展示的实现
-
干货:Kibana 可视化ElasticSearch数据展示分析
-
变量关系可视化展示
-
数据可视化练习——会议论文收录信息可视化与分析
-
数据可视化展示——echarts