README.md 19.6 KB
Newer Older
X
xfcygaocan 已提交
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
# <p align=center>`UNIMO`</p>

Code for the main conference of ACL 2021 long paper [UNIMO: Towards Unified-Modal Understanding and Generation via Cross-Modal Contrastive Learning](https://arxiv.org/pdf/2012.15409.pdf)


## Abstract

Existed pre-training methods either focus on single-modal tasks or multi-modal tasks, and cannot effectively adapt to each other.
They can only utilize single-modal data (i.e., text or image) or limited multi-modal data (i.e., image-text pairs).
In this work, we propose a UNIfied-MOdal pre-training architecture, namely `UNIMO`, which can effectively adapt to both single-modal and multi-modal understanding and generation tasks.
Large scale of free text corpus and image collections are utilized to improve the capability of visual and textual understanding, and cross-modal contrastive learning (CMCL) is leveraged to align the textual and visual information into a unified semantic space over a corpus of image-text pairs augmented with related images and texts.
With the help of rich non-paired single-modal data, our model is able to learn more generalizable representations, by allowing textual knowledge and visual knowledge to enhance each other in the unified semantic space.
The experimental results show that `UNIMO` greatly improves the performance of several single-modal and multi-modal downstream tasks.

![UNIMO](images/framework.png#pic_center)


## Performance

Results on multi-modal understanding and generation tasks:

![UNIMO](images/multiple.png#pic_center)

Results on single-modal understanding and generation tasks:

![UNIMO](images/single.png#pic_center)

---

## TODOs
31
- [] Add VQA tasks
X
xfcygaocan 已提交
32 33 34 35 36

## Dependencies
python 3.7.4\
paddlepaddle-gpu==1.8.4.post107\
pyrouge==0.1.3
37
regex==2020.7.14
X
xfcygaocan 已提交
38 39 40

## Pre-trained Models
`UNIMO` adopts large-scale text corpus, image collections and image-text aligned datasets as the pre-training data. 
41
We provide `UNIMO` pre-trained models below:
X
xfcygaocan 已提交
42 43 44

[UNIMO base](https://unimo.bj.bcebos.com/model/unimo_base_en.tar.gz) (lowercased | 12 layers)

45 46 47 48 49 50
[UNIMO-mnli base](https://unimo.bj.bcebos.com/model/unimo_mnli_base_en.tar.gz) (lowercased | 12 layers)

[UNIMO large](https://unimo.bj.bcebos.com/model/unimo_large_en.tar.gz) (lowercased | 24 layers)

[UNIMO-mnli large](https://unimo.bj.bcebos.com/model/unimo_mnli_large_en.tar.gz) (lowercased | 24 layers)

X
xfcygaocan 已提交
51
```
52
MODEL_SIZE=base # base | mnli_base | large | mnli_large
X
xfcygaocan 已提交
53 54 55 56 57 58
cd /path/to/model_files
wget --no-check-certificate -q https://unimo.bj.bcebos.com/model/unimo_${MODEL_SIZE}_en.tar.gz
tar -zxf unimo_${MODEL_SIZE}_en.tar.gz
```

## Experiments
59
Our fine-tuning experiments are carried on V100 GPU. The following are the startup methods and basic settings of all downstream tasks:
X
xfcygaocan 已提交
60 61 62 63 64 65 66 67 68 69 70

<table>
    <tr>
        <td><strong><center>Task Type</strong></td>
        <td><strong><center>Datatset</strong></td>
        <td><strong><center>Pre-trained Models</strong></td>
        <td><strong><center>Start Command</strong></td>
        <td><strong><center>V100 GPU Cards</strong></td>
        <td><strong><center>Running Time</strong></td>
    </tr>
    <tr>
71 72
        <td rowspan="8"><center>Text Understanding<center></td>
        <td rowspan="2"><center>SST-2<center></td>
X
xfcygaocan 已提交
73 74 75 76 77 78
        <td><center>UNIMO base</td>
        <td><center>sh ./script/classification/SST-2/run.sh</td>
        <td><center>8</td>
        <td><center>9h</td>
    </tr>
    <tr>
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
        <td><center>UNIMO large</td>
        <td><center>sh ./script/classification/SST-2_large/run.sh</td>
        <td><center>8</td>
        <td><center>14h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>CoLA<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/classification/CoLA/run.sh</td>
        <td><center>4</td>
        <td><center>2h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/classification/CoLA_large/run.sh</td>
        <td><center>4</td>
        <td><center>4h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>MNLI-AX<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/classification/MNLI-AX/run.sh</td>
        <td><center>8</td>
        <td><center>1d20h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/classification/MNLI-AX_large/run.sh</td>
        <td><center>8</td>
        <td><center>2d13h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>STS-B<center></td>
        <td><center>UNIMO-mnli base</td>
        <td><center>sh ./script/regression/STS-B/run.sh</td>
        <td><center>8</td>
        <td><center>2h</td>
    </tr>
    <tr>
        <td><center>UNIMO-mnli large</td>
        <td><center>sh ./script/regression/STS-B_large/run.sh</td>
        <td><center>8</td>
        <td><center>4h</td>
    </tr>
    <tr>
        <td rowspan="8"><center>Text Generation<center></td>
        <td rowspan="2"><center>CNN/DailyMail<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/seq2seq/cnndm/run.sh</td>
        <td><center>4</td>
        <td><center>1d8h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/seq2seq/cnndm_large/run.sh</td>
        <td><center>4</td>
        <td><center>3d18h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>Gigaword<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/seq2seq/gigaword/run.sh</td>
        <td><center>4</td>
        <td><center>1d3h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/seq2seq/gigaword_large/run.sh</td>
        <td><center>4</td>
        <td><center>2d3h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>CoQA<center></td>
X
xfcygaocan 已提交
152 153 154 155 156 157
        <td><center>UNIMO base</td>
        <td><center>sh ./script/seq2seq/coqa/run.sh</td>
        <td><center>4</td>
        <td><center>7h</td>
    </tr>
    <tr>
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
        <td><center>UNIMO large</td>
        <td><center>sh ./script/seq2seq/coqa_large/run.sh</td>
        <td><center>4</td>
        <td><center>22h</td>
    </tr>
    <tr>
        <td rowspan="2"><center>Squad_QG<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/seq2seq/squad_qg/run.sh</td>
        <td><center>4</td>
        <td><center>4h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/seq2seq/squad_qg_large/run.sh</td>
        <td><center>4</td>
        <td><center>8h</td>
    </tr>
    <tr>
        <td rowspan="6"><center>Multi-Modal Understanding<center></td>
        <td rowspan="2"><center>Flickr30k<center></td>
X
xfcygaocan 已提交
179 180 181 182 183
        <td><center>UNIMO base</td>
        <td><center>sh ./script/retrieval/Flickr30k/run.sh</td>
        <td><center>16</td>
        <td><center>3d</td>
    </tr>
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/retrieval/Flickr30k_large/run.sh</td>
        <td><center>16</td>
        <td><center>3d</td>
    </tr>
    <tr>
        <td rowspan="2"><center>SNLI-VE<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/visual_entailment/SNLI-VE/run.sh</td>
        <td><center>16</td>
        <td><center>16h</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/visual_entailment/SNLI-VE_large/run.sh</td>
        <td><center>16</td>
        <td><center>2d</td>
    </tr>
    <tr>
        <td rowspan="2"><center>VQA<center></td>
        <td><center>UNIMO base</td>
        <td><center>-</td>
        <td><center>-</td>
        <td><center>-</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>-</td>
        <td><center>-</td>
        <td><center>-</td>
    </tr>
    <tr>
        <td rowspan="6"><center>Multi-Modal Generation<center></td>
        <td rowspan="2"><center>COCO Caption<center></td>
        <td><center>UNIMO base</td>
        <td><center>sh ./script/img2txt/coco/run.sh</td>
        <td><center>16</td>
        <td><center>3d</td>
    </tr>
    <tr>
        <td><center>UNIMO large</td>
        <td><center>sh ./script/img2txt/coco_large/run.sh</td>
        <td><center>16</td>
        <td><center>4d</td>
    </tr>
X
xfcygaocan 已提交
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
<table>

---
## Text Understanding Tasks

### (1) Sentiment Classification

#### Download SST-2 dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/SST-2.tar.gz
tar -zxf SST.tar.gz
```

#### Run the following common to train and evaluate on the SST-2 dataset:

For base model:
```
bash ./script/classification/SST-2/run.sh
```
250 251 252 253
For large model:
```
bash ./script/classification/SST-2_large/run.sh
```
X
xfcygaocan 已提交
254 255 256 257 258 259 260 261 262 263 264 265

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>Acc</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>95.1</td>
    </tr>
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>96.8</td>
    </tr>
<table>

### (2) Natural Language Inference

#### Download MNLI-AX dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/MNLI-AX.tar.gz
tar -zxf MNLI-AX.tar.gz
```

#### Run the following common to train and evaluate on the MNLI-AX dataset:

For base model:
```
bash ./script/classification/MNLI-AX/run.sh
```
For large model:
```
bash ./script/classification/MNLI-AX_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>Acc-(m/mm)</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>86.8/86.7</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>89.8/89.5</td>
    </tr>
X
xfcygaocan 已提交
307 308
<table>

309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385

### (3) Similarity Tasks

#### Download STS-B dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/STS-B.tar.gz
tar -zxf STS-B.tar.gz
```

#### Run the following common to train and evaluate on the STS-B dataset:

For base model:
```
bash ./script/regression/STS-B/run.sh
```
For large model:
```
bash ./script/regression/STS-B_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>Pearson correlation</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>91.0</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>92.6</td>
    </tr>
<table>


### (4) Linguistic Acceptability Judgments

#### Download CoLA dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/CoLA.tar.gz
tar -zxf CoLA.tar.gz
```

#### Run the following common to train and evaluate on the CoLA dataset:

For base model:
```
bash ./script/classification/CoLA/run.sh
```
For large model:
```
bash ./script/classification/CoLA_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>Matthews correlation</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>65.4</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>68.5</td>
    </tr>
<table>


X
xfcygaocan 已提交
386 387
##  Text Generation Tasks

388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
### (1) Document Summarization

#### Download CNN/DailyMail dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/cnndm.tar.gz
tar -zxf cnndm.tar.gz
```

#### Download evaluation script:
```
cd src/eval/tasks
wget --no-check-certificate -q https://unimo.bj.bcebos.com/eval_script/cnndm.tar.gz
tar -zxf cnndm.tar.gz
```

#### Run the following common to train and evaluate on the CNN/DailyMail dataset:

For base model:
```
bash ./script/seq2seq/cnndm/run.sh
```
For large model:
```
bash ./script/seq2seq/cnndm_large/run.sh
```

#### Evaluation Results:


<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>ROUGE-1</strong></td>
        <td><strong><center>ROUGE-2</strong></td>
        <td><strong><center>ROUGE-L</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>42.42</td>
        <td><center>20.12</td>
        <td><center>39.61</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>43.51</td>
        <td><center>20.65</td>
        <td><center>40.63</td>
    </tr>
<table>


### (2) Sentence Compression

#### Download Gigaword dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/gigaword.tar.gz
tar -zxf gigaword.tar.gz
```

#### Download evaluation script:
```
cd src/eval/tasks
wget --no-check-certificate -q https://unimo.bj.bcebos.com/eval_script/gigaword.tar.gz
tar -zxf gigaword.tar.gz
```

#### Run the following common to train and evaluate on the Gigaword dataset:

For base model:
```
bash ./script/seq2seq/gigaword/run.sh
```
For large model:
```
bash ./script/seq2seq/gigaword_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>ROUGE-1</strong></td>
        <td><strong><center>ROUGE-2</strong></td>
        <td><strong><center>ROUGE-L</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>38.80</td>
        <td><center>19.99</td>
        <td><center>36.27</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>39.71</td>
        <td><center>20.37</td>
        <td><center>36.88</td>
    </tr>
<table>


### (3) Question Generation

#### Download Squad dataset:
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/squad_qg.tar.gz
tar -zxf squad_qg.tar.gz
```

#### Download evaluation script:
```
cd src/eval/tasks
wget --no-check-certificate -q https://unimo.bj.bcebos.com/eval_script/squad_qg.tar.gz
tar -zxf squad_qg.tar.gz
```

#### Run the following common to train and evaluate on the Squad dataset:

For base model:
```
bash ./script/seq2seq/squad_qg/run.sh
```
For large model:
```
bash ./script/seq2seq/squad_qg_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>BLUE4</strong></td>
        <td><strong><center>METEOR</strong></td>
        <td><strong><center>ROUGE-L</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>22.78</td>
        <td><center>25.24</td>
        <td><center>51.34</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>24.59</td>
        <td><center>26.39</td>
        <td><center>52.47</td>
    </tr>
<table>

### (4) Conversation Question Answering
X
xfcygaocan 已提交
542 543

#### Download CoQA dataset:
544

X
xfcygaocan 已提交
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/coqa.tar.gz
tar -zxf coqa.tar.gz
```

#### Download evaluation script:
```
cd src/eval/tasks
wget --no-check-certificate -q https://unimo.bj.bcebos.com/eval_script/coqa.tar.gz
tar -zxf coqa.tar.gz
```


#### Run the following common to train and evaluate on the CoQA dataset:

For base model:
```
bash ./script/seq2seq/coqa/run.sh
```
565 566 567 568
For large model:
```
bash ./script/seq2seq/coqa_large/run.sh
```
X
xfcygaocan 已提交
569 570 571 572 573 574 575 576 577 578 579 580

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>Acc</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>80.2</td>
    </tr>
581 582 583 584
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>84.9</td>
    </tr>
X
xfcygaocan 已提交
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
<table>


##  Multi-Modal Understanding Tasks

### (1) Image-Text Retrieval

#### Download Flickr30k dataset:

##### Note: Visual features are extracted by [bottom-up-attention](https://github.com/peteanderson80/bottom-up-attention)

```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/Flickr30k.tar.gz # occupies about 37G disk space
tar -zxf Flickr30k.tar.gz
```

#### Run the following common to train and evaluate on the Flickr30k dataset:

For base model:
```
bash ./script/retrieval/Flickr30k/run.sh
```
608 609 610 611
For large model:
```
bash ./script/retrieval/Flickr30k_large/run.sh
```
X
xfcygaocan 已提交
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629

#### Evaluation Results:

Results of Image Retrieval task on Flickr30k dataset

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>R@1</strong></td>
        <td><strong><center>R@5</strong></td>
        <td><strong><center>R@10</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>74.66</td>
        <td><center>93.40</td>
        <td><center>96.08</td>
    </tr>
630 631 632 633 634 635
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>78.04</td>
        <td><center>94.24</td>
        <td><center>97.12</td>
    </tr>
X
xfcygaocan 已提交
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
<table>

Results of Text Retrieval task on Flickr30k dataset

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>R@1</strong></td>
        <td><strong><center>R@5</strong></td>
        <td><strong><center>R@10</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>89.70</td>
        <td><center>98.40</td>
        <td><center>99.10</td>
    </tr>
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>89.40</td>
        <td><center>98.90</td>
        <td><center>99.80</td>
    </tr>
<table>

### (2) Visual Entailment

#### Download SNLI-VE dataset:

##### Note: Visual features are extracted by [bottom-up-attention](https://github.com/peteanderson80/bottom-up-attention)

```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/SNLI-VE.tar.gz
tar -zxf SNLI-VE.tar.gz
```

#### Run the following common to train and evaluate on the SNLI-VE dataset:

For base model:
```
bash ./script/visual_entailment/SNLI-VE/run.sh
```
For large model:
```
bash ./script/visual_entailment/SNLI-VE_large/run.sh
```

#### Evaluation Results:

Results of Visual Entailment task on SNLI-VE dataset

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>dev</strong></td>
        <td><strong><center>test</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>80.00</td>
        <td><center>79.10</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>81.11</td>
        <td><center>80.63</td>
    </tr>
<table>


##  Multi-Modal Generation Tasks

### (1) Image Caption Generation

#### Download COCO Caption dataset:

##### Note: Visual features are extracted by [bottom-up-attention](https://github.com/peteanderson80/bottom-up-attention)

```
cd /path/to/data
wget --no-check-certificate -q https://unimo.bj.bcebos.com/data/coco.tar.gz
tar -zxf coco.tar.gz
```

#### Download evaluation script:
```
cd src/eval/tasks
wget --no-check-certificate -q https://unimo.bj.bcebos.com/eval_script/coco.tar.gz
tar -zxf coco.tar.gz
```

#### Run the following common to train and evaluate on the COCO Caption dataset:

For base model:
```
bash ./script/img2txt/coco/run.sh
```
For large model:
```
bash ./script/img2txt/coco_large/run.sh
```

#### Evaluation Results:

<table>
    <tr>
        <td><strong><center>Model</strong></td>
        <td><strong><center>BLUE4</strong></td>
        <td><strong><center>CIDEr</strong></td>
    </tr>
    <tr>
        <td><center>UNIMO-base</td>
        <td><center>38.8</td>
        <td><center>124.4</td>
    </tr>
    <tr>
        <td><center>UNIMO-large</td>
        <td><center>39.6</td>
        <td><center>127.7</td>
    </tr>
X
xfcygaocan 已提交
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777
<table>

---

Citation
---
If you find our paper and code useful, please cite the following paper:
```
@article{li2020unimo,
  title={UNIMO: Towards Unified-Modal Understanding and Generation via Cross-Modal Contrastive Learning},
  author={Li, Wei and Gao, Can and Niu, Guocheng and Xiao, Xinyan and Liu, Hao and Liu, Jiachen and Wu, Hua and Wang, Haifeng},
  journal={arXiv preprint arXiv:2012.15409},
  year={2020}
}
```

Contact information
---

For help or issues using `UNIMO`, please submit a GitHub issue.

778
For personal communication related to `UNIMO`, please contact Wei Li (liwei85@baidu.com), Guocheng Niu (niuguocheng@baidu.com) , Can Gao (gaocan01@baidu.com).