-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJSONspecNew
63 lines (57 loc) · 1.48 KB
/
JSONspecNew
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
GET /query
parameters are the same as before: minWords, maxWords, filter (string of comma separated words), top, data (the actual query)
responds with e.g.
{
"result_count": 10,
"query": "your query string",
"query_results": [
{
sent_text: "this is a sentence", similarity: 0.8,
lj_post_id: 743, sent_num: 2, username: "username",
post_time: "1114875060", url: "http://username.livejournal.com/743.html",
mood: null
}, ...
]
}
POST /contexts
post data should be a json, format:
{
window: 1, // number of +/- sents, or null if you want full posts
sents: [
[743, 2], // tuples of post_id, sent_num (resulting from a query, like above)
[134, 3],
...
]
}
responds with e.g.
{
"result_count": 10,
"query_results": [
[
{
sent_text: "this is a sentence before sent 1", similarity: 0.1,
lj_post_id: 743, sent_num: 1, username: "username",
post_time: "1114875060", url: "http://username.livejournal.com/743.html",
mood: null
},
{
sent_text: "this is sent 1", similarity: 0.8,
lj_post_id: 743, sent_num: 2, username: "username",
post_time: "1114875060", url: "http://username.livejournal.com/743.html",
mood: null
}
{
sent_text: "this is a sentence after sent 1", similarity: 0.2,
lj_post_id: 743, sent_num: 3, username: "username",
post_time: "1114875060", url: "http://username.livejournal.com/743.html",
mood: null
}
],
[
{... another sentence ...},
{... another sentence ...},
...
],
...
]
}