Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload ariadne mining script #1340

Open
wants to merge 1 commit into
base: marekhorst_1339_perform_test_mining_for_Ariadne_resources
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PRAGMA temp_store_directory = '.';

create temp table pubs
as select * from (setschema 'id, text' select jdictsplit(c1, 'id', 'text') from stdinput()) where text <>'' and text not null;

select jdict('documentId', docid,'ariadneId', doi, 'langingPage', dsetID, 'confidenceLevel', sqroot(min(1.49,max(confidence))/1.5),'textsnippet',context) from
(
select docid, doi, dsetID, case when length(context) > 120 then round((length(titles) + conf*10)/(length(context)*1.0),2) else round(conf/10.0,2) end as confidence, context from (
select docid, doi, dsetID, regexpcountuniquematches(bag,lower(regexpr('\W|_',context,' '))) + 2*regexprmatches(creator,lower(context)) + regexprmatches(publisher,lower(context)) as conf, regexprmatches(titles,lower(context)) as match, titles, context
from
(
select docid, lower(stripchars(middle,'_')) as mystart,
prev||' '||middle||' '||next as context from
(setschema 'docid,prev,middle,next' select id as docid, textwindow2s(normalizetext(textreferences(text)),15,3,15) from pubs)
)
,titlesandtriples where mystart = words and match) where confidence > 0.28
union all
select docid, dsetID,doi, 0.8 as confidence,middle from
( setschema 'docid,middle' select id as docid, textwindow(regexpr("\n",text," "),0,0,1,"((?=.*[0-9])(?=.*[\D])(.{11,})|http.{10,})") as middle from pubs), ariadneurls
where normalizetext(stripchars(middle,'.)(,[]\/')) = nurl
) group by docid, doi;