Project

General

Profile

1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
6
    <script src="http://services.ceon.pl/oapdemonstrators/common.js"></script>
7
    <link rel="stylesheet" type="text/css" href="http://services.ceon.pl/oapdemonstrators/style.css">
8

    
9
</head>
10
<body>
11
<div id="container">
12
    <title>Document similarity</title>
13
    <div id="sidebar">
14
        <h3>Document similarity details</h3>
15
        
16
				<p>
17
				<b>Usage.</b> Please provide DOI of the document and the service will show the metadata of the given document along with documents with similar content. The documents are searched for in <a href="http://www.ncbi.nlm.nih.gov/pmc/tools/openftlist/" target="_blank">PMC Open Access Subset</a> database retrieved on 01/16/2014.
18
				</p>
19

    
20
				<p>
21
				The service returns a result containing the following fields:
22

    
23
				</p><ul>
24
					<li><b>givenArticleDetails</b>: metadata of the documents retrieved from database,</li>
25
					<li><b>similarResults</b>: metadata of the most similar documents from the database that match a given citation along with normalised similarity score (between 0.0 and 1.0). Note that more than one of returned documents might have the same similarity value equal 1.0 assigned; this is normal and is a result of how the algorithm works.</li>
26
				</ul>
27
				<p></p>
28

    
29
				<p>
30
				<b>Machine-readable service.</b> The service provides a <a href="http://services.ceon.pl/docsim/api.html">RESTful API</a> which can be accessed by external client services.
31
				</p>
32

    
33
				<p>
34
				<b>General description of the algorithm</b>.Majority of the processing presented by the service is done off-line. Namely, for each document stored in the database, words coming from it are transformed into terms (using stemming), and their importance is measured with TF-IDF weighting scheme. Only top <i>n</i> terms among them are selected and used to compute similarity score. The method utilizes inverted dictionary technique to efficiently calculate document similarity, considering only objects related to each other (sharing at least one important common word). The computed similarity score is based on cosine similarity (or its substitute normalized to the range of <i>[0, 1]</i>). See our paper <a href="http://arxiv.org/abs/1303.5367" target="_blank">arXiv:1303.5367</a> for more details.				
35
                </p>
36
    </div>
37
    <div id="page">
38
        <div id="form">
39
            <input id="doiText" type="text" class="green" placeholder="Paste your DOI here" onblur="this.placeholder = 'Paste your DOI here'" onfocus="this.placeholder = ''" name="doi" />
40

    
41
            <br>
42
            <div id="examples">
43
                <a id="example1" class="btn example" type="button"  value="Insert example 1" data-tooltip="Document with prominent 'actin' keyword">Insert example 1</a>
44
                <a id="example2" class="btn example" type="button"  value="Insert example 2" data-tooltip="Document with prominent 'G-Quadruplex, Porphyrins' keywords">Insert example 2</a>
45
                <a id="example3" class="btn example" type="button"  value="Insert example 3" data-tooltip="Document with prominent 'Neurology' keyword">Insert example 3</a>
46
            </div>
47

    
48
            <br>
49

    
50
            <input id="submit" class="btn" type="submit" value="Submit">
51
        </div>
52

    
53
        <div id="result" style="display:none">
54
            <h4>Result:</h4>
55
            <div id="result_menu">
56

    
57
                <ul>
58
                    <li><a id="JSON" class="no_link sheet">JSON</a></li>
59
                    <li><a id="table" class="no_link sheet">Table</a></li>
60
                </ul>
61
            </div>
62
                    <span id="result_section">
63
                       <pre id="result_pre"></pre>
64
                    </span>
65
        </div>
66
    </div>
67
</div> <!-- container -->
68

    
69
<script>
70
    var example_input1 = '10.1083/jcb1565iti5'
71
    var example_input2 = '10.1371/journal.pone.0035586'
72
    var example_input3 = '10.3389/fneur.2011.00001'
73

    
74
    $("#example1").click(function(){
75
        addExample(example_input1,$("#doiText"))})
76
    $("#example2").click(function(){
77
        addExample(example_input2,$("#doiText"))})
78
    $("#example3").click(function(){
79
        addExample(example_input3,$("#doiText"))})
80

    
81
    $("#submit").click(function(){
82
        $("#result_pre").html("")
83
        $("#result").hide()
84
        var text= $("#doiText").val()
85
        if(text){
86
            var input = new Object()
87
            var doi = new Object()
88
            doi.doi =  text
89
            input.inputObject = doi
90
            var url = "http://services.ceon.pl/coansys/document_similarity.do"
91
            restService("POST",url,input,$("#result_pre")).done(function(result) {
92
                var response_json = JSON.parse(result)
93

    
94
                if (response_json.hasOwnProperty("error")) {
95
                    $("#result_pre").html('<span>Error</span>')
96

    
97
                }  else {
98
                    var clickable_JSON = syntaxHighlight(JSON.stringify(response_json,null,4))
99

    
100
                    var table = docSimTable(response_json)
101
                    $("#result_pre").html(clickable_JSON)
102
                    addLinkToDoiNext()
103
                    $("#JSON").addClass('active')
104
                    $("#table").removeClass('active')
105
                    $("#result").show()
106

    
107
                    $("#JSON").click(function(){
108
                        $("#result_pre").html(clickable_JSON)
109
                        addLinkToDoiNext()
110
                        $(this).addClass('active')
111
                        $("#table").removeClass('active')
112

    
113
                    })
114
                    $("#table").click(function(){
115
                        $("#result_pre").html(table)
116
                        addLinkToDoi()
117
                        $(this).addClass('active')
118
                        $("#JSON").removeClass('active')
119
                    })
120

    
121
                }
122

    
123
            })
124

    
125

    
126
        }
127

    
128
    })
129

    
130
    function docSimTable(json) {
131
        console.log(json)
132
        var articleDetails =  json["outputObject"]["givenArticleDetails"]
133
        var similarResults = json["outputObject"]["similarResults"]
134
        var table =  '' +
135
                '<table id="main_table" class="no_border">' +
136
                '<tr><th class="section">Reference Article:</th></tr>' +
137
                '<tr><td>' +
138
                '<table class="extracted_data_table">' +
139
                    '<tr><th>DOI</th><td class="doi">'+articleDetails["doi"]+'</td></tr>' +
140
                    '<tr><th>Title</th><td>'+articleDetails["title"]+'</td></tr>' +
141
                    '<tr><th>Authors</th><td>'+articleDetails["authors"].join(', ')+'</td></tr>' +
142
                    '<tr><th>Year</th><td>'+articleDetails["year"]+'</td></tr>' +
143
                '</table>' +
144
                '</td></tr>'
145

    
146
        table+='<tr><th class="section">Similar documents:</th></tr>' +
147
                '<tr><td>'
148

    
149
        if (similarResults.length==0){
150
            table+="<span>No similar documents found</span>"
151
        } else {
152
            table+='<table class="result_table"><tr><th>Nr</th><th>DOI</th><th>Title</th><th>Authors</th><th>Year</th><th>Similarity</th></tr>';
153
            for (var i=0;i<similarResults.length;i++){
154
                table+='<tr>' +
155
                        '<td class="number_td"><span class="docsim_nr">'+(i+1)+'</span></td>' +
156
                        '<td class="doc_doi doi">'+similarResults[i]["doi"]+'</td>' +
157
                        '<td>'+similarResults[i]["title"]+'</td>' +
158
                        '<td>'+similarResults[i]["authors"].join(', ')+'</td>' +
159
                        '<td class="doc_year">'+similarResults[i]["year"]+'</td>' +
160
                        '<td class="doc_score">'+similarResults[i]["sim"]+'</td>' +
161
                        '</tr>'
162
            }
163
        }
164

    
165
        table+='</td></tr>' +
166
                '</table></table>'
167
        return table
168
    }
169

    
170
</script>
171
</body>
172
</html>
(2-2/2)