Selamat datang di Valencer , API RESTful untuk menanyakan kombinasi realisasi sintaksis argumen predikat – alias pola valensi – dalam database FrameNet.
@InProceedings{kabbach-ribeyre:2016:COLINGDEMO,
author = {Kabbach, Alexandre and Ribeyre, Corentin},
title = {{Valencer: an API to Query Valence Patterns in FrameNet}},
booktitle = {{Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: System Demonstrations}},
month = dec,
year = {2016},
address = {Osaka, Japan},
publisher = {The COLING 2016 Organizing Committee},
pages = {156--160},
url = {http://aclweb.org/anthology/C16-2033}
}
Dokumentasi lengkap API tersedia di Halaman GitHub kami
Untuk detail tambahan mengenai latar belakang API, arsitekturnya, dan kasus penggunaannya, lihat makalah COLING 2016 kami
Untuk mengimpor data FrameNet ke database Mongo, lihat NoFrameNet
Alternatifnya, kami menyediakan dua dump MongoDB untuk data FrameNet 1.5 dan FrameNet 1.7. Jika Anda menjalankan MongoDB di localhost dan port 27017, Anda dapat dengan mudah mengimpor dump setelah dibuka ritsletingnya melalui:
mongorestore -d fn_en_170 /path/to/fn_en_170/
Informasi lebih lanjut tersedia melalui dokumentasi MongoDB
Jika Anda menggunakan dump kami, jangan lupa untuk mengajukan Permintaan Data FrameNet.
Jalankan perintah berikut di terminal Anda, di bawah direktori Valencer:
npm install
Ubah file config/production.js
sesuai dengan pengaturan yang Anda inginkan:
const config = {
logger: logger.info,
api: {
port: 3030,
},
databases: {
server: 'localhost',
port: 27017,
names: {
en: {
150: 'fn_en_150',
160: 'fn_en_160',
170: 'fn_en_170',
},
ja: {
100: 'fn_ja_100',
},
},
},
};
Untuk memulai satu instance Valencer, jalankan perintah berikut di terminal Anda, di bawah direktori Valencer:
npm run start
Untuk performa yang lebih baik, Anda juga dapat memulai beberapa instance Valencer. Untuk melakukannya, teruskan argumen -i
ke npm:
npm run start -- -i num_instances
Untuk membuat jumlah maksimum instance bergantung pada thread yang tersedia, lakukan:
npm run start -- -i 0
Untuk menghentikan server, jalankan:
npm run stop
Perhatikan bahwa ini akan menghentikan SEMUA instance Valencer
Untuk memantau Valencer API setelah dimulai, jalankan:
pm2 monit valencer
Jika pm2 tidak diinstal secara global di lingkungan Anda, Anda juga dapat melakukan:
./node_modules/.bin/pm2 monit valencer
Untuk mengakses log Valencer, jalankan:
pm2 logs valencer
Berikut adalah contoh permintaan HTTP yang menanyakan 10 AnnotationSet pertama dalam database yang mengacu pada pola valensi Donor.NP.Ext Theme.NP.Obj
:
curl -i "http://localhost:3030/v5/en/170/annoSets?vp=Donor.NP.Ext+Theme.NP.Obj"
Kueri di atas akan menghasilkan:
HTTP/1.1 200 OK
Vary: Origin, Accept-Encoding
Total-Count: 190
Skip: 0
Limit: 10
Content-Type: application/json; charset=utf-8
Content-Length: 4069
Date: Wed, 24 Jan 2018 09:27:14 GMT
Connection: keep-alive
[{"labels":["5a62f8d9e3bf318cbac8aef0","5a62f8d9e3bf318cbac8aef1","5a62f8d9e3bf318cbac8aef2","5a62f8d9e3bf318cbac8aef3","5a62f8d9e3bf318cbac8aef4","5a62f8d9e3bf318cbac8aef5","5a62f8d9e3bf318cbac8aef6","5a62f8d9e3bf318cbac8aef7","5a62f8d9e3bf318cbac8aef8","5a62f8d9e3bf318cbac8aef9","5a62f8d9e3bf318cbac8aefa"],"_id":2614616,"lexUnit":11593,"sentence":1569707,"pattern":"5a62f8d9e3bf318cbac8aefc"},{"labels":["5a62fb28e3bf318cba2ca68f","5a62fb28e3bf318cba2ca690","5a62fb28e3bf318cba2ca691","5a62fb28e3bf318cba2ca692","5a62fb28e3bf318cba2ca693","5a62fb28e3bf318cba2ca694","5a62fb28e3bf318cba2ca695","5a62fb28e3bf318cba2ca696","5a62fb28e3bf318cba2ca697","5a62fb28e3bf318cba2ca698"],"_id":6525725,"lexUnit":11593,"sentence":4096745,"pattern":"5a62f8d9e3bf318cbac8aefc"},{"labels":["5a62fb22e3bf318cba2b987f","5a62fb22e3bf318cba2b9880","5a62fb22e3bf318cba2b9881","5a62fb22e3bf318cba2b9882","5a62fb22e3bf318cba2b9883","5a62fb22e3bf318cba2b9884","5a62fb22e3bf318cba2b9885","5a62fb22e3bf318cba2b9886","5a62fb22e3bf318cba2b9887","5a62fb22e3bf318cba2b9888"],"_id":6527126,"lexUnit":11593,"sentence":4097344,"pattern":"5a62f8d9e3bf318cbac8aefc"},{"labels":["5a62fb25e3bf318cba2c3666","5a62fb25e3bf318cba2c3667","5a62fb25e3bf318cba2c3668","5a62fb25e3bf318cba2c3669","5a62fb25e3bf318cba2c366a","5a62fb25e3bf318cba2c366b","5a62fb25e3bf318cba2c366c","5a62fb25e3bf318cba2c366d","5a62fb25e3bf318cba2c366e","5a62fb25e3bf318cba2c366f"],"_id":6540825,"lexUnit":11593,"sentence":4100815,"pattern":"5a62f8d9e3bf318cbac8aefc"},{"labels":["5a62fb02e3bf318cba27b2ed","5a62fb02e3bf318cba27b2ee","5a62fb02e3bf318cba27b2ef","5a62fb02e3bf318cba27b2f0","5a62fb02e3bf318cba27b2f1","5a62fb02e3bf318cba27b2f2","5a62fb02e3bf318cba27b2f3","5a62fb02e3bf318cba27b2f4","5a62fb02e3bf318cba27b2f5","5a62fb02e3bf318cba27b2f6","5a62fb02e3bf318cba27b2f7"],"_id":6542617,"lexUnit":11593,"sentence":4101222,"pattern":"5a62f8d9e3bf318cbac8aefc"},{"labels":["5a62f8d9e3bf318cbac8aff1","5a62f8d9e3bf318cbac8aff2","5a62f8d9e3bf318cbac8aff3","5a62f8d9e3bf318cbac8aff4","5a62f8d9e3bf318cbac8aff5","5a62f8d9e3bf318cbac8aff6","5a62f8d9e3bf318cbac8aff7","5a62f8d9e3bf318cbac8aff8","5a62f8d9e3bf318cbac8aff9","5a62f8d9e3bf318cbac8affa","5a62f8d9e3bf318cbac8affb","5a62f8d9e3bf318cbac8affc","5a62f8d9e3bf318cbac8affd","5a62f8d9e3bf318cbac8affe"],"_id":2615829,"lexUnit":11593,"sentence":1569663,"pattern":"5a62f8d9e3bf318cbac8b000"},{"labels":["5a62f8d9e3bf318cbac8b019","5a62f8d9e3bf318cbac8b01a","5a62f8d9e3bf318cbac8b01b","5a62f8d9e3bf318cbac8b01c","5a62f8d9e3bf318cbac8b01d","5a62f8d9e3bf318cbac8b01e","5a62f8d9e3bf318cbac8b01f","5a62f8d9e3bf318cbac8b020","5a62f8d9e3bf318cbac8b021"],"_id":2615833,"lexUnit":11593,"sentence":1569671,"pattern":"5a62f8d9e3bf318cbac8b022"},{"labels":["5a62fb2ae3bf318cba2cfde5","5a62fb2ae3bf318cba2cfde6","5a62fb2ae3bf318cba2cfde7","5a62fb2ae3bf318cba2cfde8","5a62fb2ae3bf318cba2cfde9","5a62fb2ae3bf318cba2cfdea","5a62fb2ae3bf318cba2cfdeb","5a62fb2ae3bf318cba2cfdec","5a62fb2ae3bf318cba2cfded","5a62fb2ae3bf318cba2cfdee","5a62fb2ae3bf318cba2cfdef","5a62fb2ae3bf318cba2cfdf0","5a62fb2ae3bf318cba2cfdf1"],"_id":6522246,"lexUnit":11593,"sentence":4096543,"pattern":"5a62f8d9e3bf318cbac8b0ff"},{"labels":["5a62fb25e3bf318cba2c3bf3","5a62fb25e3bf318cba2c3bf4","5a62fb25e3bf318cba2c3bf5","5a62fb25e3bf318cba2c3bf6","5a62fb25e3bf318cba2c3bf7","5a62fb25e3bf318cba2c3bf8","5a62fb25e3bf318cba2c3bf9","5a62fb25e3bf318cba2c3bfa","5a62fb25e3bf318cba2c3bfb","5a62fb25e3bf318cba2c3bfc","5a62fb25e3bf318cba2c3bfd","5a62fb25e3bf318cba2c3bfe","5a62fb25e3bf318cba2c3bff"],"_id":6540732,"lexUnit":11593,"sentence":4100829,"pattern":"5a62f8d9e3bf318cbac8b0ff"},{"labels":["5a62f8e9e3bf318cbaccc46f","5a62f8e9e3bf318cbaccc470","5a62f8e9e3bf318cbaccc471","5a62f8e9e3bf318cbaccc472","5a62f8e9e3bf318cbaccc473","5a62f8e9e3bf318cbaccc474","5a62f8e9e3bf318cbaccc475","5a62f8e9e3bf318cbaccc476","5a62f8e9e3bf318cbaccc477","5a62f8e9e3bf318cbaccc478","5a62f8e9e3bf318cbaccc479","5a62f8e9e3bf318cbaccc47a","5a62f8e9e3bf318cbaccc47b"],"_id":2447117,"lexUnit":12046,"sentence":1500476,"pattern":"5a62f8e9e3bf318cbaccc480"}]