bhavitvyamalik commited on
Commit
68fa3ca
1 Parent(s): 312f3f7

add references, blue, bias section

Browse files
Files changed (3) hide show
  1. app.py +22 -1
  2. sections/pretraining.md +5 -7
  3. sections/references.md +58 -7
app.py CHANGED
@@ -72,7 +72,8 @@ st.write(
72
  )
73
 
74
  st.sidebar.title("Generation Parameters")
75
- max_length = st.sidebar.number_input("Max Length", min_value=16, max_value=128, value=64, step=1, help="The maximum length of sequence to be generated.")
 
76
  do_sample = st.sidebar.checkbox("Sample", value=False, help="Sample from the model instead of using beam search.")
77
  top_k = st.sidebar.number_input("Top K", min_value=10, max_value=200, value=50, step=1, help="The number of highest probability vocabulary tokens to keep for top-k-filtering.")
78
  num_beams = st.sidebar.number_input(label="Number of Beams", min_value=2, max_value=10, value=4, step=1, help="Number of beams to be used in beam search.")
@@ -97,6 +98,26 @@ with st.beta_expander("Article"):
97
  st.markdown(read_markdown("pretraining.md"))
98
  st.write(read_markdown("challenges.md"))
99
  st.write(read_markdown("social_impact.md"))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  st.write(read_markdown("future_scope.md"))
101
  st.write(read_markdown("references.md"))
102
  # st.write(read_markdown("checkpoints.md"))
 
72
  )
73
 
74
  st.sidebar.title("Generation Parameters")
75
+ # max_length = st.sidebar.number_input("Max Length", min_value=16, max_value=128, value=64, step=1, help="The maximum length of sequence to be generated.")
76
+ max_length = 64
77
  do_sample = st.sidebar.checkbox("Sample", value=False, help="Sample from the model instead of using beam search.")
78
  top_k = st.sidebar.number_input("Top K", min_value=10, max_value=200, value=50, step=1, help="The number of highest probability vocabulary tokens to keep for top-k-filtering.")
79
  num_beams = st.sidebar.number_input(label="Number of Beams", min_value=2, max_value=10, value=4, step=1, help="Number of beams to be used in beam search.")
 
98
  st.markdown(read_markdown("pretraining.md"))
99
  st.write(read_markdown("challenges.md"))
100
  st.write(read_markdown("social_impact.md"))
101
+ st.write(read_markdown("bias.md"))
102
+
103
+ col1, col2, col3, col4 = st.beta_columns([0.5,2.5,2.5,0.5])
104
+ with col2:
105
+ st.image("./misc/examples/female_dev_1.jpg", width=350, caption = 'German Caption: <PERSON> arbeitet an einem Computer.', use_column_width='always')
106
+ with col3:
107
+ st.image("./misc/examples/female_doctor.jpg", width=350, caption = 'English Caption: A portrait of <PERSON>, a doctor who specializes in health care.', use_column_width='always')
108
+
109
+ col1, col2, col3, col4 = st.beta_columns([0.5,2.5,2.5,0.5])
110
+ with col2:
111
+ st.image("./misc/examples/female_doctor_1.jpg", width=350, caption = 'Spanish Caption: El Dr. <PERSON> es un estudiante de posgrado.', use_column_width='always')
112
+ with col3:
113
+ st.image("./misc/examples/women_cricket.jpg", width=350, caption = 'English Caption: <PERSON> of India bats against <PERSON> of Australia during the first Twenty20 match between India and Australia at Indian Bowl Stadium in New Delhi on Friday. - PTI', use_column_width='always')
114
+
115
+ col1, col2, col3, col4 = st.beta_columns([0.5,2.5,2.5,0.5])
116
+ with col2:
117
+ st.image("./misc/examples/female_dev_2.jpg", width=350, caption = "French Caption: Un écran d'ordinateur avec un écran d'ordinateur ouvert.", use_column_width='always')
118
+ with col3:
119
+ st.image("./misc/examples/female_biker_resized.jpg", width=350, caption = 'German Caption: <PERSON> auf dem Motorrad von <PERSON>.', use_column_width='always')
120
+
121
  st.write(read_markdown("future_scope.md"))
122
  st.write(read_markdown("references.md"))
123
  # st.write(read_markdown("checkpoints.md"))
sections/pretraining.md CHANGED
@@ -9,13 +9,11 @@ The dataset we use for pre-training is a cleaned version of Conceptual 12M. The
9
 
10
  The model is shown in the image above. We create a custom model in Flax which integerates the CLIP Vision model as an encoder inside mBART model. We also use custom configs and modules in order to accomodate for these changes, and allow loading from mBART and CLIP Vision checkpoints. The image is fed to the CLIP Vision encoder and the shifted token ids are fed to the mBART decoder. We use the `facebook/mbart-large-50` and `openai/clip-vit-base-patch32` checkpoints for mBART and CLIP Vision models, respectively. All our code is available on [GitHub](https://github.com/gchhablani/multilingual-image-captioning).
11
 
12
- Our model reached **eval loss of ~2.6** around ~70K steps. Here are the BLEU^ scores for different languages:
13
 
14
  |Language |BLEU-1|BLEU-2|BLEU-3|BLEU-4|
15
  |--------------------------|------|------|------|------|
16
- |English | 0.163| 0.127| 0.10 | 0.081|
17
- |Spanish | 0.171| 0.133| 0.114| 0.082|
18
- |German | 0.165| 0.129| 0.103| 0.077|
19
- |French | 0.162| 0.124| 0.104| 0.073|
20
-
21
- ^BLEU scores are out of 1
 
9
 
10
  The model is shown in the image above. We create a custom model in Flax which integerates the CLIP Vision model as an encoder inside mBART model. We also use custom configs and modules in order to accomodate for these changes, and allow loading from mBART and CLIP Vision checkpoints. The image is fed to the CLIP Vision encoder and the shifted token ids are fed to the mBART decoder. We use the `facebook/mbart-large-50` and `openai/clip-vit-base-patch32` checkpoints for mBART and CLIP Vision models, respectively. All our code is available on [GitHub](https://github.com/gchhablani/multilingual-image-captioning).
11
 
12
+ Our model reached **eval loss of ~2.6** around ~70K steps. Here are the BLEU scores (out of 1) for different languages:
13
 
14
  |Language |BLEU-1|BLEU-2|BLEU-3|BLEU-4|
15
  |--------------------------|------|------|------|------|
16
+ |English | 0.13083| 0.08887| 0.06681 | 0.04899|
17
+ |Spanish | 0.15981| 0.09858| 0.06918| 0.04776|
18
+ |German | 0.14234| 0.09817| 0.07405| 0.0515|
19
+ |French | 0.13021| 0.08862| 0.06598| 0.04647|
 
 
sections/references.md CHANGED
@@ -1,12 +1,63 @@
1
  ## References
2
- - [Conceptual 12M Dataset](https://github.com/google-research-datasets/conceptual-12m)
3
 
4
- - [Hybrid CLIP Example](https://github.com/huggingface/transformers/blob/master/src/transformers/models/clip/modeling_flax_clip.py)
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- - [mBART50 Modeling File](https://github.com/huggingface/transformers/blob/master/src/transformers/models/mbart/modeling_flax_mbart.py)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- - [CLIP Modeling File](https://github.com/huggingface/transformers/blob/master/src/transformers/models/clip/modeling_flax_clip.py)
 
 
 
 
 
 
 
 
 
9
 
10
- - [Hybrid CLIP Training Script](https://github.com/huggingface/transformers/blob/master/examples/research_projects/jax-projects/hybrid_clip/run_hybrid_clip.py)
11
-
12
- - [Summarization Training Script](https://github.com/huggingface/transformers/blob/master/examples/flax/summarization/run_summarization_flax.py)
 
 
 
 
 
 
 
 
1
  ## References
 
2
 
3
+ ```
4
+ @inproceedings{wolf-etal-2020-transformers,
5
+ title = "Transformers: State-of-the-Art Natural Language Processing",
6
+ author = "Thomas Wolf and Lysandre Debut and Victor Sanh and Julien Chaumond and Clement Delangue and Anthony Moi and Pierric Cistac and Tim Rault and Rémi Louf and Morgan Funtowicz and Joe Davison and Sam Shleifer and Patrick von Platen and Clara Ma and Yacine Jernite and Julien Plu and Canwen Xu and Teven Le Scao and Sylvain Gugger and Mariama Drame and Quentin Lhoest and Alexander M. Rush",
7
+ booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
8
+ month = oct,
9
+ year = "2020",
10
+ address = "Online",
11
+ publisher = "Association for Computational Linguistics",
12
+ url = "https://www.aclweb.org/anthology/2020.emnlp-demos.6",
13
+ pages = "38--45"
14
+ }
15
+ ```
16
 
17
+ ```
18
+ @inproceedings{changpinyo2021cc12m,
19
+ title = {{Conceptual 12M}: Pushing Web-Scale Image-Text Pre-Training To Recognize Long-Tail Visual Concepts},
20
+ author = {Changpinyo, Soravit and Sharma, Piyush and Ding, Nan and Soricut, Radu},
21
+ booktitle = {CVPR},
22
+ year = {2021},
23
+ }
24
+ ```
25
+ ```
26
+ @InProceedings{mariannmt,
27
+ title = {Marian: Fast Neural Machine Translation in {C++}},
28
+ author = {Junczys-Dowmunt, Marcin and Grundkiewicz, Roman and
29
+ Dwojak, Tomasz and Hoang, Hieu and Heafield, Kenneth and
30
+ Neckermann, Tom and Seide, Frank and Germann, Ulrich and
31
+ Fikri Aji, Alham and Bogoychev, Nikolay and
32
+ Martins, Andr\'{e} F. T. and Birch, Alexandra},
33
+ booktitle = {Proceedings of ACL 2018, System Demonstrations},
34
+ pages = {116--121},
35
+ publisher = {Association for Computational Linguistics},
36
+ year = {2018},
37
+ month = {July},
38
+ address = {Melbourne, Australia},
39
+ url = {http://www.aclweb.org/anthology/P18-4020}
40
+ }
41
+ ```
42
 
43
+ ```
44
+ @article{liu2020multilingual,
45
+ title={Multilingual Denoising Pre-training for Neural Machine Translation},
46
+ author={Yinhan Liu and Jiatao Gu and Naman Goyal and Xian Li and Sergey Edunov and Marjan Ghazvininejad and Mike Lewis and Luke Zettlemoyer},
47
+ year={2020},
48
+ eprint={2001.08210},
49
+ archivePrefix={arXiv},
50
+ primaryClass={cs.CL}
51
+ }
52
+ ```
53
 
54
+ ```
55
+ @misc{radford2021learning,
56
+ title={Learning Transferable Visual Models From Natural Language Supervision},
57
+ author={Alec Radford and Jong Wook Kim and Chris Hallacy and Aditya Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
58
+ year={2021},
59
+ eprint={2103.00020},
60
+ archivePrefix={arXiv},
61
+ primaryClass={cs.CV}
62
+ }
63
+ ```