ParlAI 由facebook開源的多任務(wù)智能對話分享,訓(xùn)練和評估平臺

[
ParlAI

特色介紹

  • 1 集成了大量的公開數(shù)據(jù)集---從公開領(lǐng)域閑聊到專業(yè)的視覺問題問答一應(yīng)俱全
  • 2 海量參考模型
  • 3 無縫銜接亞馬遜Mechanical Turk系統(tǒng),完成數(shù)據(jù)收集,訓(xùn)練和人工評估

新建一個目錄

 mkdir  parlAI

下載和安裝

git clone https://github.com/facebookresearch/ParlAI.git
cd ParlAI; python setup.py develop

可以看到輸出

Cloning into 'ParlAI'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 24850 (delta 18), reused 10 (delta 3), pack-reused 24803
Receiving objects: 100% (24850/24850), 28.80 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (17462/17462), done.

安裝速度還是很快的
之后進入目錄
執(zhí)行測試代碼

這個測試是在1k訓(xùn)練樣本的BabI任務(wù)上隨機輸出 10條任務(wù)1的樣例結(jié)果

python examples/display_data.py -t babi:task1k:1

這個中間可能有很多依賴需要安裝,請自行處理吧
正常運行的結(jié)果,我們來看一下

[ optional arguments: ] 
[  display_ignore_fields: agent_reply ]
[  max_display_len: 1000 ]
[  num_examples: 10 ]
[ Main ParlAI Arguments: ] 
[  batchsize: 1 ]
[  datapath: /home/xxx/parlAI/ParlAI/data ]
[  datatype: train:stream ]
[  download_path: /home/xxx/parlAI/ParlAI/downloads ]
[  hide_labels: False ]
[  image_mode: raw ]
[  init_opt: None ]
[  multitask_weights: [1] ]
[  numthreads: 1 ]
[  show_advanced_args: False ]
[  task: babi:task1k:1 ]
[ ParlAI Model Arguments: ] 
[  dict_class: None ]
[  init_model: None ]
[  model: None ]
[  model_file: None ]
[ PytorchData Arguments: ] 
[  batch_length_range: 5 ]
[  batch_sort_cache_type: pop ]
[  batch_sort_field: text ]
[  numworkers: 4 ]
[  pytorch_context_length: -1 ]
[  pytorch_datapath: None ]
[  pytorch_include_labels: True ]
[  pytorch_preprocess: False ]
[  pytorch_teacher_batch_sort: False ]
[  pytorch_teacher_dataset: None ]
[  pytorch_teacher_task: None ]
[  shuffle: False ]
[ ParlAI Image Preprocessing Arguments: ] 
[  image_cropsize: 224 ]
[  image_size: 256 ]
[ Current ParlAI commit: e8d0a75d291c7bb4b4e5565d60a899f794c10963 ]
[creating task(s): babi:task1k:1]
[building data: /home/xxx/parlAI/ParlAI/data/bAbI]
[ downloading: http://parl.ai/downloads/babi/babi.tar.gz to /home/xxx/parlAI/ParlAI/data/bAbI/babi.tar.gz ]
Downloading babi.tar.gz: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 19.2M/19.2M [00:05<00:00, 3.29MB/s]
unpacking babi.tar.gz
[loading fbdialog data:/home/xxx/parlAI/ParlAI/data/bAbI/tasks_1-20_v1-2/en-valid-nosf/qa1_train.txt]
[loading fbdialog data:/home/xxx/parlAI/ParlAI/data/bAbI/tasks_1-20_v1-2/en-valid-nosf/qa1_train.txt]
[babi:task1k:1]: Mary moved to the bathroom.
John went to the hallway.
Where is Mary?
[labels: bathroom]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: Daniel went back to the hallway.
Sandra moved to the garden.
Where is Daniel?
[labels: hallway]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: John moved to the office.
Sandra journeyed to the bathroom.
Where is Daniel?
[labels: hallway]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: Mary moved to the hallway.
Daniel travelled to the office.
Where is Daniel?
[labels: office]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: John went back to the garden.
John moved to the bedroom.
Where is Sandra?
[labels: bathroom]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
- - - - - - - - - - - - - - - - - - - - -
~~
[babi:task1k:1]: Sandra travelled to the office.
Sandra went to the bathroom.
Where is Sandra?
[labels: bathroom]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: Mary went to the bedroom.
Daniel moved to the hallway.
Where is Sandra?
[labels: bathroom]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: John went to the garden.
John travelled to the office.
Where is Sandra?
[labels: bathroom]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: Daniel journeyed to the bedroom.
Daniel travelled to the hallway.
Where is John?
[labels: office]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
~~
[babi:task1k:1]: John went to the bedroom.
John travelled to the office.
Where is Daniel?
[labels: hallway]
[label_candidates: office|hallway|kitchen|bathroom|bedroom|...and 1 more]
- - - - - - - - - - - - - - - - - - - - -
~~
[ loaded 180 episodes with a total of 900 examples ]
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容