posmoni 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +42 -0
- data/INSTALL.md +7 -0
- data/README.md +184 -0
- data/Rakefile +12 -0
- data/lib/generators/posmoni/install_generator.rb +18 -0
- data/lib/generators/templates/posmoni_api.rb +7 -0
- data/lib/posmoni.rb +26 -0
- data/lib/posmoni/connector.rb +107 -0
- data/lib/posmoni/error.rb +15 -0
- data/lib/posmoni/interface.rb +22 -0
- data/lib/posmoni/moderation.rb +13 -0
- data/lib/posmoni/response.rb +40 -0
- data/lib/posmoni/version.rb +3 -0
- data/posmoni.gemspec +25 -0
- data/test/fixtures/image_choice/all.json +27 -0
- data/test/fixtures/image_choice/create.json +25 -0
- data/test/fixtures/image_closed_question/all.json +21 -0
- data/test/fixtures/image_closed_question/create.json +19 -0
- data/test/fixtures/image_document_verification/all.json +143 -0
- data/test/fixtures/image_document_verification/create.json +27 -0
- data/test/fixtures/image_message/all.json +22 -0
- data/test/fixtures/image_message/create.json +20 -0
- data/test/fixtures/image_photo_tag/all.json +22 -0
- data/test/fixtures/image_photo_tag/create.json +20 -0
- data/test/fixtures/moderation/all.json +68 -0
- data/test/fixtures/moderation/create.json +26 -0
- data/test/fixtures/moderation/find_by.json +26 -0
- data/test/fixtures/nanameue_human/all.json +25 -0
- data/test/fixtures/nanameue_human/create.json +21 -0
- data/test/fixtures/prediction/all.json +21 -0
- data/test/fixtures/prediction/create.json +19 -0
- data/test/fixtures/text_category/all.json +34 -0
- data/test/fixtures/text_category/create.json +27 -0
- data/test/fixtures/text_closed_question/all.json +27 -0
- data/test/fixtures/text_closed_question/create.json +20 -0
- data/test/fixtures/text_conversation/all.json +33 -0
- data/test/fixtures/text_conversation/create.json +26 -0
- data/test/fixtures/text_ja/all.json +35 -0
- data/test/fixtures/text_ja/create.json +28 -0
- data/test/fixtures/video_classification/all.json +21 -0
- data/test/fixtures/video_classification/create.json +19 -0
- data/test/helper/file_reader.rb +11 -0
- data/test/posmoni/moderation_test.rb +46 -0
- data/test/posmoni_test.rb +14 -0
- data/test/test_helper.rb +25 -0
- metadata +174 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"image": {
|
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
|
5
|
+
"answer": [],
|
|
6
|
+
"credit_charged": 0,
|
|
7
|
+
"custom_id": null,
|
|
8
|
+
"data": "https://assets-cdn.github.com/images/modules/open_graph/github-mark.png",
|
|
9
|
+
"instruction": "Instruction",
|
|
10
|
+
"postback_url": "https://9333bbac.ngrok.io/callbacks",
|
|
11
|
+
"processed_at": null,
|
|
12
|
+
"project_id": 102,
|
|
13
|
+
"status": "unprocess"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"meta": {
|
|
17
|
+
"code": 200,
|
|
18
|
+
"message": "success"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "5db6c2476ce1c068b2773ae6",
|
|
5
|
+
"type": "moderation",
|
|
6
|
+
"attributes": {
|
|
7
|
+
"custom_id": "test",
|
|
8
|
+
"data": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR83e5RhkOsU2wKswgQbrbR3LjtdTFjquXzmzKHt7q8kJemXoc4QA&s",
|
|
9
|
+
"postback_url": null,
|
|
10
|
+
"postback_method": "GET",
|
|
11
|
+
"result": null,
|
|
12
|
+
"type": "image",
|
|
13
|
+
"info": {},
|
|
14
|
+
"created_at": "2019-10-28T17:26:15.597+07:00",
|
|
15
|
+
"processed_at": null,
|
|
16
|
+
"status": "unprocessed",
|
|
17
|
+
"dataset_id": null,
|
|
18
|
+
"id": "5db6c2476ce1c068b2773ae6",
|
|
19
|
+
"project_id": 245,
|
|
20
|
+
"sent_postback_yet": false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "5db6c3a7bcbc136ac7c8ff6c",
|
|
25
|
+
"type": "moderation",
|
|
26
|
+
"attributes": {
|
|
27
|
+
"custom_id": null,
|
|
28
|
+
"data": "https://ae01.alicdn.com/kf/HTB1UdUBXdfvK1RjSszhq6AcGFXaW/shaonvmeiwu-Thin-translucent-lace-underwear-with-small-boobs-tucked-into-a-sexy-bra-with-three-rows.jpg",
|
|
29
|
+
"postback_url": null,
|
|
30
|
+
"postback_method": "GET",
|
|
31
|
+
"result": null,
|
|
32
|
+
"type": "image",
|
|
33
|
+
"info": {},
|
|
34
|
+
"created_at": "2019-10-28T17:32:07.251+07:00",
|
|
35
|
+
"processed_at": null,
|
|
36
|
+
"status": "unprocessed",
|
|
37
|
+
"dataset_id": null,
|
|
38
|
+
"id": "5db6c3a7bcbc136ac7c8ff6c",
|
|
39
|
+
"project_id": 245,
|
|
40
|
+
"sent_postback_yet": false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "5db7a2d9bcbc136ac9343da8",
|
|
45
|
+
"type": "moderation",
|
|
46
|
+
"attributes": {
|
|
47
|
+
"custom_id": null,
|
|
48
|
+
"data": "https://upload.wikimedia.org/wikipedia/commons/c/c5/Bikini_Model_Jassi_2.jpg",
|
|
49
|
+
"postback_url": null,
|
|
50
|
+
"postback_method": "GET",
|
|
51
|
+
"result": null,
|
|
52
|
+
"type": "image",
|
|
53
|
+
"info": {},
|
|
54
|
+
"created_at": "2019-10-29T09:24:25.725+07:00",
|
|
55
|
+
"processed_at": null,
|
|
56
|
+
"status": "unprocessed",
|
|
57
|
+
"dataset_id": null,
|
|
58
|
+
"id": "5db7a2d9bcbc136ac9343da8",
|
|
59
|
+
"project_id": 245,
|
|
60
|
+
"sent_postback_yet": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"meta": {
|
|
65
|
+
"code": 200,
|
|
66
|
+
"message": "OK"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5db7a2d9bcbc136ac9343da8",
|
|
4
|
+
"type": "moderation",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"custom_id": null,
|
|
7
|
+
"data": "https:upload.wikimedia.org/wikipedia/commons/c/c5/Bikini_Model_Jassi_2.jpg",
|
|
8
|
+
"postback_url": null,
|
|
9
|
+
"postback_method": "GET",
|
|
10
|
+
"result": null,
|
|
11
|
+
"type": "image",
|
|
12
|
+
"info": {},
|
|
13
|
+
"created_at": "2019-10-29T09::.725+07:",
|
|
14
|
+
"processed_at": null,
|
|
15
|
+
"status": "unprocessed",
|
|
16
|
+
"dataset_id": null,
|
|
17
|
+
"id": "5db7a2d9bcbc136ac9343da8",
|
|
18
|
+
"project_id": 245,
|
|
19
|
+
"sent_postback_yet": false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"meta": {
|
|
23
|
+
"code": 201,
|
|
24
|
+
"message": "Created"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5db6c2476ce1c068b2773ae6",
|
|
4
|
+
"type": "moderation",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"custom_id": "test",
|
|
7
|
+
"data": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR83e5RhkOsU2wKswgQbrbR3LjtdTFjquXzmzKHt7q8kJemXoc4QA&s",
|
|
8
|
+
"postback_url": null,
|
|
9
|
+
"postback_method": "GET",
|
|
10
|
+
"result": null,
|
|
11
|
+
"type": "image",
|
|
12
|
+
"info": {},
|
|
13
|
+
"created_at": "2019-10-28T17:26:15.597+07:00",
|
|
14
|
+
"processed_at": null,
|
|
15
|
+
"status": "unprocessed",
|
|
16
|
+
"dataset_id": null,
|
|
17
|
+
"id": "5db6c2476ce1c068b2773ae6",
|
|
18
|
+
"project_id": 245,
|
|
19
|
+
"sent_postback_yet": false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"meta": {
|
|
23
|
+
"code": 200,
|
|
24
|
+
"message": "OK"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"images": [
|
|
4
|
+
{
|
|
5
|
+
"id": "5c218fcc1eda3f457430ee45",
|
|
6
|
+
"answer": "approved",
|
|
7
|
+
"credit_charged": 0,
|
|
8
|
+
"custom_id": null,
|
|
9
|
+
"data": "data",
|
|
10
|
+
"mode": "human",
|
|
11
|
+
"created_at": "2018-12-25T09:02:52.650+07:00",
|
|
12
|
+
"postback": true,
|
|
13
|
+
"postback_url": "https://datawow.io",
|
|
14
|
+
"processed_at": "2018-12-28T12:30:06.415+07:00",
|
|
15
|
+
"project_id": 199,
|
|
16
|
+
"staff_id": null,
|
|
17
|
+
"status": "processed"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"meta": {
|
|
22
|
+
"code": 200,
|
|
23
|
+
"message": "success"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5c218fcc1eda3f457430ee45",
|
|
4
|
+
"answer": null,
|
|
5
|
+
"credit_charged": 0,
|
|
6
|
+
"custom_id": null,
|
|
7
|
+
"data": "data",
|
|
8
|
+
"mode": "human",
|
|
9
|
+
"created_at": "2018-12-25T09:02:52.650+07:00",
|
|
10
|
+
"postback": true,
|
|
11
|
+
"postback_url": "https://datawow.io",
|
|
12
|
+
"processed_at": null,
|
|
13
|
+
"project_id": 199,
|
|
14
|
+
"staff_id": null,
|
|
15
|
+
"status": "unprocess"
|
|
16
|
+
},
|
|
17
|
+
"meta": {
|
|
18
|
+
"code": 201,
|
|
19
|
+
"message": "created success"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"image": [
|
|
4
|
+
{
|
|
5
|
+
"id": "5a44671ab3957c2ab5c33326",
|
|
6
|
+
"answer": "approved",
|
|
7
|
+
"credit_charged": 0,
|
|
8
|
+
"custom_id": null,
|
|
9
|
+
"data": "https://s3-ap-northeast-1.amazonaws.com/marinchat/uploads/user/6951939/profile_icon/veOSbIBCR.jpg",
|
|
10
|
+
"postback_url": "http://localhost:3000/projects",
|
|
11
|
+
"processed_at": "2017-11-16T10:10:56.282+07:00",
|
|
12
|
+
"project_id": 93,
|
|
13
|
+
"status": "processed"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"meta": {
|
|
18
|
+
"code": 200,
|
|
19
|
+
"message": "success"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"image": {
|
|
4
|
+
"id": "5a44671ab3957c2ab5c33326",
|
|
5
|
+
"answer": "approved",
|
|
6
|
+
"credit_charged": 0,
|
|
7
|
+
"custom_id": null,
|
|
8
|
+
"data": "https://s3-ap-northeast-1.amazonaws.com/marinchat/uploads/user/6951939/profile_icon/veOSbIBCR.jpg",
|
|
9
|
+
"postback_url": "http://localhost:3000/projects",
|
|
10
|
+
"processed_at": "2017-11-16T10:10:56.282+07:00",
|
|
11
|
+
"project_id": 93,
|
|
12
|
+
"status": "processed"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"meta": {
|
|
16
|
+
"code": 200,
|
|
17
|
+
"message": "success"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "5b7ce9085a5e43fb0775be86",
|
|
5
|
+
"custom_id": "string",
|
|
6
|
+
"title": "string",
|
|
7
|
+
"status": "unprocessed",
|
|
8
|
+
"conversation": [
|
|
9
|
+
{
|
|
10
|
+
"name": "string",
|
|
11
|
+
"message": "string"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"categories": [],
|
|
15
|
+
"staff_id": null,
|
|
16
|
+
"postback_url": "string",
|
|
17
|
+
"postback_method": "string",
|
|
18
|
+
"project_id": 159,
|
|
19
|
+
"processed_at": null,
|
|
20
|
+
"allow_empty": false,
|
|
21
|
+
"created_at": "2018-08-22T11:39:36.885+07:00",
|
|
22
|
+
"qa_status": null
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"meta": {
|
|
26
|
+
"code": 200,
|
|
27
|
+
"message": "success",
|
|
28
|
+
"current_page": 1,
|
|
29
|
+
"next_page": -1,
|
|
30
|
+
"prev_page": -1,
|
|
31
|
+
"total_pages": 1,
|
|
32
|
+
"total_count": 1
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5b7ce9085a5e43fb0775be86",
|
|
4
|
+
"custom_id": "string",
|
|
5
|
+
"title": "string",
|
|
6
|
+
"status": "unprocessed",
|
|
7
|
+
"conversation": [
|
|
8
|
+
{
|
|
9
|
+
"name": "string",
|
|
10
|
+
"message": "string"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"categories": [],
|
|
14
|
+
"staff_id": null,
|
|
15
|
+
"postback_url": "string",
|
|
16
|
+
"postback_method": "string",
|
|
17
|
+
"project_id": 159,
|
|
18
|
+
"processed_at": null,
|
|
19
|
+
"allow_empty": false,
|
|
20
|
+
"created_at": "2018-08-22T11:39:36.885+07:00",
|
|
21
|
+
"qa_status": null
|
|
22
|
+
},
|
|
23
|
+
"meta": {
|
|
24
|
+
"code": 200,
|
|
25
|
+
"message": "success"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "5b7ce84b5a5e43fb0775be85",
|
|
5
|
+
"custom_id": null,
|
|
6
|
+
"status": "unprocessed",
|
|
7
|
+
"data": "test",
|
|
8
|
+
"answer": "",
|
|
9
|
+
"staff_id": null,
|
|
10
|
+
"postback_url": null,
|
|
11
|
+
"postback_method": "GET",
|
|
12
|
+
"project_id": 157,
|
|
13
|
+
"processed_at": null,
|
|
14
|
+
"created_at": "2018-08-22T11:36:27.634+07:00",
|
|
15
|
+
"qa_status": null
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"meta": {
|
|
19
|
+
"code": 200,
|
|
20
|
+
"message": "success",
|
|
21
|
+
"current_page": 1,
|
|
22
|
+
"next_page": -1,
|
|
23
|
+
"prev_page": -1,
|
|
24
|
+
"total_pages": 1,
|
|
25
|
+
"total_count": 2
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5b7ce84b5a5e43fb0775be85",
|
|
4
|
+
"custom_id": null,
|
|
5
|
+
"status": "unprocessed",
|
|
6
|
+
"data": "test",
|
|
7
|
+
"answer": "",
|
|
8
|
+
"staff_id": null,
|
|
9
|
+
"postback_url": null,
|
|
10
|
+
"postback_method": "GET",
|
|
11
|
+
"project_id": 157,
|
|
12
|
+
"processed_at": null,
|
|
13
|
+
"created_at": "2018-08-22T11:36:27.634+07:00",
|
|
14
|
+
"qa_status": null
|
|
15
|
+
},
|
|
16
|
+
"meta": {
|
|
17
|
+
"code": 200,
|
|
18
|
+
"message": "success"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "5b7ce97d5a5e43fb0775be87",
|
|
5
|
+
"answers": [
|
|
6
|
+
""
|
|
7
|
+
],
|
|
8
|
+
"custom_id": null,
|
|
9
|
+
"custom_conversation_ids": [
|
|
10
|
+
"1"
|
|
11
|
+
],
|
|
12
|
+
"status": "unprocessed",
|
|
13
|
+
"conversation": [
|
|
14
|
+
"test"
|
|
15
|
+
],
|
|
16
|
+
"staff_id": null,
|
|
17
|
+
"postback_url": null,
|
|
18
|
+
"postback_method": "GET",
|
|
19
|
+
"project_id": 160,
|
|
20
|
+
"created_at": "2018-08-22T11:41:33.572+07:00",
|
|
21
|
+
"processed_at": null
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"meta": {
|
|
25
|
+
"code": 200,
|
|
26
|
+
"message": "success",
|
|
27
|
+
"current_page": 1,
|
|
28
|
+
"next_page": -1,
|
|
29
|
+
"prev_page": -1,
|
|
30
|
+
"total_pages": 1,
|
|
31
|
+
"total_count": 1
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"id": "5b7ce97d5a5e43fb0775be87",
|
|
4
|
+
"answers": [
|
|
5
|
+
""
|
|
6
|
+
],
|
|
7
|
+
"custom_id": null,
|
|
8
|
+
"custom_conversation_ids": [
|
|
9
|
+
"1"
|
|
10
|
+
],
|
|
11
|
+
"status": "unprocessed",
|
|
12
|
+
"conversation": [
|
|
13
|
+
"test"
|
|
14
|
+
],
|
|
15
|
+
"staff_id": null,
|
|
16
|
+
"postback_url": null,
|
|
17
|
+
"postback_method": "GET",
|
|
18
|
+
"project_id": 160,
|
|
19
|
+
"created_at": "2018-08-22T11:41:33.572+07:00",
|
|
20
|
+
"processed_at": null
|
|
21
|
+
},
|
|
22
|
+
"meta": {
|
|
23
|
+
"code": 200,
|
|
24
|
+
"message": "success"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": [
|
|
3
|
+
{
|
|
4
|
+
"id": "5c2eb38f0df256348de69a1f",
|
|
5
|
+
"created_at": "2019-01-04T08:14:55.372+07:00",
|
|
6
|
+
"custom_id": null,
|
|
7
|
+
"data": "foobar",
|
|
8
|
+
"processed_at": "2019-01-04T08:14:55.371+07:00",
|
|
9
|
+
"project_id": 202,
|
|
10
|
+
"results": {
|
|
11
|
+
"declined": 0.001,
|
|
12
|
+
"developing_model": {
|
|
13
|
+
"approved": 0.9909,
|
|
14
|
+
"pros-sexual": 0.0046,
|
|
15
|
+
"sns": 0.045
|
|
16
|
+
},
|
|
17
|
+
"pros_fasttext": 0.001,
|
|
18
|
+
"sexual_fasttext": 0.001,
|
|
19
|
+
"sexual_fasttext_romanji": 0.001,
|
|
20
|
+
"sns_fasttext": 0.001
|
|
21
|
+
},
|
|
22
|
+
"staff_id": 999998,
|
|
23
|
+
"status": "done"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"meta": {
|
|
27
|
+
"code": 200,
|
|
28
|
+
"message": "success",
|
|
29
|
+
"current_page": 1,
|
|
30
|
+
"next_page": -1,
|
|
31
|
+
"prev_page": -1,
|
|
32
|
+
"total_pages": 1,
|
|
33
|
+
"total_count": 2
|
|
34
|
+
}
|
|
35
|
+
}
|