File size: 941 Bytes
1dd5fed
 
 
 
 
 
 
 
b743bd2
 
 
dda9e37
b743bd2
dda9e37
 
 
 
 
 
b743bd2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dda9e37
 
1dd5fed
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  Hello world!
  <div id="res"></div>


  <script>
    console.log("started")

  papers = [
    {'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
    {'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}
  ]

  async function getSimilarity(papers) {
    await fetch('similarity', {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(papers)
    });

    const content = await rawResponse.json();
    document.querySelector("#res").innerHTML = content.toString()
  }



  getSimilarity(papers)

  </script>
</body>
</html>