|
|
|
**(POST)** Mengirim pertanyaan baru
|
|
|
|
|
|
|
|
## URI
|
|
|
|
```
|
|
|
|
/questionList
|
|
|
|
```
|
|
|
|
|
|
|
|
## Form Body
|
|
|
|
* `timestamp` - Waktu pengiriman
|
|
|
|
* `sender` - Identitas pengirim
|
|
|
|
* `question` - Pertanyaan yang ingin diajukan
|
|
|
|
* `task_id` - `ask_question`
|
|
|
|
|
|
|
|
## Contoh
|
|
|
|
### Request
|
|
|
|
```
|
|
|
|
import requests
|
|
|
|
|
|
|
|
url = "http://127.0.0.1:5000/questionList"
|
|
|
|
|
|
|
|
payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"timestamp\"\r\n\r\n02/05/2018 01:11\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"sender\"\r\n\r\nimperativa\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"question\"\r\n\r\nkalo gakbisa download kuesioner dari pcl itu harus gimana?\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"task_id\"\r\n\r\nask_question\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"
|
|
|
|
headers = {'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'}
|
|
|
|
|
|
|
|
response = requests.request("POST", url, data=payload, headers=headers)
|
|
|
|
|
|
|
|
print(response.text)
|
|
|
|
```
|
|
|
|
### Hasil
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"message": "sucessfully post a new question",
|
|
|
|
"suggestion": [
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.5674938559532166,
|
|
|
|
"answer": null,
|
|
|
|
"doc2vec_score": 0.572007417678833,
|
|
|
|
"question": "kalo kortim nggak bisa download isian kuesioner dari PCL itu masalahnya di mana ya?",
|
|
|
|
"combined_score": 0.6289874911308289,
|
|
|
|
"id": 46,
|
|
|
|
"lda_score": 0.9415346384048462,
|
|
|
|
"timestamp": "21/02/2017 08:15"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.3660670220851898,
|
|
|
|
"answer": "belum pake capi terbaru berarti ya? itu gak berhasil sebenernya downloadnya. coba update capi dulu > cek konfigurasi platformnya udah masukin username sama passwordnya > coba lagi",
|
|
|
|
"doc2vec_score": 0.49775606393814087,
|
|
|
|
"question": "kok aku download isian g muncul di ubah kuesioner ya?",
|
|
|
|
"combined_score": 0.4227854907512665,
|
|
|
|
"id": 608,
|
|
|
|
"lda_score": 0.6591546535491943,
|
|
|
|
"timestamp": "03/03/2017 22:16"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.337196946144104,
|
|
|
|
"answer": null,
|
|
|
|
"doc2vec_score": 0.7630796432495117,
|
|
|
|
"question": "14,7936 gak bisa download kuesioner yang diminta periksa kembali sama kortim. Kenapa ya?",
|
|
|
|
"combined_score": 0.4014209508895874,
|
|
|
|
"id": 42,
|
|
|
|
"lda_score": 0.5564148426055908,
|
|
|
|
"timestamp": "20/02/2017 22:49"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.32432591915130615,
|
|
|
|
"answer": "Itu di hapus kuesioner memang seluruh kuesioenr yang pernah dibuat di device itu (termasuk yang sudah di kirim), sedangkan untuk yang di ubah kuesioner itu yang belum terkirim",
|
|
|
|
"doc2vec_score": 0.7621834874153137,
|
|
|
|
"question": "Kalo kuesioner di hapus kuesioner ada 3, tapi di ubah kuesioner cm ada 1 . Itu kenapa?",
|
|
|
|
"combined_score": 0.3920971751213074,
|
|
|
|
"id": 459,
|
|
|
|
"lda_score": 0.5603522062301636,
|
|
|
|
"timestamp": "27/02/2017 09:42"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.3386794328689575,
|
|
|
|
"answer": null,
|
|
|
|
"doc2vec_score": 0.6227691173553467,
|
|
|
|
"question": "Kalau di menu monitoring status kuesionernya clear dan terkirim, tidak bisa di download ya?",
|
|
|
|
"combined_score": 0.3914686441421509,
|
|
|
|
"id": 71,
|
|
|
|
"lda_score": 0.5457174181938171,
|
|
|
|
"timestamp": "22/02/2017 10:43"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.26560741662979126,
|
|
|
|
"answer": "tidak akan terduplikasi, yang kalian periksa pasti yang kalian bisa download dari menu monitoring",
|
|
|
|
"doc2vec_score": 0.727049708366394,
|
|
|
|
"question": "Apakah kortim bisa mendownload ulang kuesioner dari PCL (monitoring), kuesioner yg didownload akan terduplicate atau tidak?",
|
|
|
|
"combined_score": 0.361257940530777,
|
|
|
|
"id": 579,
|
|
|
|
"lda_score": 0.6624449491500854,
|
|
|
|
"timestamp": "01/03/2017 10:17"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.2595076262950897,
|
|
|
|
"answer": null,
|
|
|
|
"doc2vec_score": 0.4848242402076721,
|
|
|
|
"question": "Kalo download isian not responding trus force close?",
|
|
|
|
"combined_score": 0.35322266817092896,
|
|
|
|
"id": 12,
|
|
|
|
"lda_score": 0.7406260967254639,
|
|
|
|
"timestamp": "15/02/2017 11:54"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.29261282086372375,
|
|
|
|
"answer": null,
|
|
|
|
"doc2vec_score": 0.430815726518631,
|
|
|
|
"question": "Klau ga bisa download hasil kuisoner pcl itu knp ya?",
|
|
|
|
"combined_score": 0.3492281436920166,
|
|
|
|
"id": 479,
|
|
|
|
"lda_score": 0.58241868019104,
|
|
|
|
"timestamp": "27/02/2017 15:05"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.2329048216342926,
|
|
|
|
"answer": "Merubah untuk apa? Jika ada kesalahan pengisian dan sudah dikirim maka kortim dapat mengembalikan untuk diperbaiki",
|
|
|
|
"doc2vec_score": 0.46032917499542236,
|
|
|
|
"question": "Apa yg terjadi kalau PCL mengubah salah 1 no ruta kuesioner tetapi nomor ruta tsb ternyata sudah ada di tab PCL, nah, kuesioner yg lama hilang, itu tertindih gitu ya?",
|
|
|
|
"combined_score": 0.2912987470626831,
|
|
|
|
"id": 554,
|
|
|
|
"lda_score": 0.49726617336273193,
|
|
|
|
"timestamp": "28/02/2017 20:42"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tfidf_score": 0.22014160454273224,
|
|
|
|
"answer": "Boleh tidak urut, disesuaikan dengan posisi barat daya.",
|
|
|
|
"doc2vec_score": 0.5414187908172607,
|
|
|
|
"question": "untuk mengerjakan listing harus urut dari segmen 1 > 2 > 3 > 4 atau boleh tidak urut dari 1> 2 > 4 > 3",
|
|
|
|
"combined_score": 0.29055145382881165,
|
|
|
|
"id": 246,
|
|
|
|
"lda_score": 0.5197484493255615,
|
|
|
|
"timestamp": "24/02/2017 08:34"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"question": {
|
|
|
|
"is_active": 0,
|
|
|
|
"sender": "imperativa",
|
|
|
|
"answer": null,
|
|
|
|
"dup_with": null,
|
|
|
|
"is_queued": 0,
|
|
|
|
"answerer": null,
|
|
|
|
"question": "kalo gakbisa download kuesioner dari pcl itu harus gimana?",
|
|
|
|
"tokenized_question": "kalo;gakbisa;download;kuesioner;dari;pcl;itu;harus;gimana",
|
|
|
|
"is_target": 0,
|
|
|
|
"timestamp": "02/05/2018 01:11"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
``` |
|
|
\ No newline at end of file |