Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LayoutLMv3] Add TensorFlow implementation #18678

Merged
merged 259 commits into from Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
d66d9a1
add main layer
ChrisFugl Aug 11, 2022
08205ff
add model
ChrisFugl Aug 11, 2022
151a42b
add checkmark in support tables
ChrisFugl Aug 11, 2022
bd4ad93
add contributors githubs
ChrisFugl Aug 11, 2022
4823e51
TensorFlow documentation
ChrisFugl Aug 11, 2022
61180c1
Add token- and sequence classification models.
EtcEc Aug 11, 2022
ea1206c
add tf-layoutlmv3 to documentation tests
ChrisFugl Aug 11, 2022
7dc9c9d
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 11, 2022
72341db
TFLayoutLMv3ForQuestionAnswering
lre Aug 11, 2022
4e85b1d
add imports to model init file
ChrisFugl Aug 11, 2022
1e8bfce
add imports to transformers init file
ChrisFugl Aug 11, 2022
3821a01
add tf layoutlmv3 entries to auto model
ChrisFugl Aug 11, 2022
d79b737
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
3780c12
output hidden states of last layer
ChrisFugl Aug 12, 2022
1feed36
auto styling
ChrisFugl Aug 15, 2022
eb92766
fix-copies
ChrisFugl Aug 15, 2022
8ac52f7
typo of layoutlmv3 (was wrongly typed as layoutlm3)
ChrisFugl Aug 15, 2022
440c122
Fix typo: "V3" --> "v3"
ChrisFugl Aug 16, 2022
5cca1fb
Add skeleton for tests
ChrisFugl Aug 16, 2022
df911a3
Add support for both int32 and int64 inputs
ChrisFugl Aug 16, 2022
773a8c2
Add huggingface profile links
ChrisFugl Aug 17, 2022
c80f25a
Test output shapes of various model types.
ChrisFugl Aug 17, 2022
674d8a1
Add integration test
ChrisFugl Aug 17, 2022
19d8735
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 17, 2022
35611fc
make style
ChrisFugl Aug 17, 2022
3a2f81e
make quality
ChrisFugl Aug 17, 2022
ad85647
Check init consistency
ChrisFugl Aug 18, 2022
8af0241
Remove debug print statements.
ChrisFugl Aug 18, 2022
70068a9
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 18, 2022
4f08871
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
a64fed1
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
328c640
Remove shape_list dependency
ChrisFugl Aug 19, 2022
a3bc5ee
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 19, 2022
6debe6f
Explicit naming of shape comments
ChrisFugl Aug 19, 2022
e89b303
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
1149aa0
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
16942d9
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
2d3f2a4
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 19, 2022
16bf1b1
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
593a9e1
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
222f643
Use LARGE_NEGATIVE instead of tf.experimental
ChrisFugl Aug 19, 2022
0ad9969
Remove superfluous else statements
ChrisFugl Aug 19, 2022
6435f28
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
1b607ba
Move get_int_dtype outside of the class
ChrisFugl Aug 19, 2022
d18bdf8
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 19, 2022
e36e7f2
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
d637b99
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
a78ca4f
Update tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
5872ad7
Add return types
ChrisFugl Aug 19, 2022
53c7237
one-hot + dense instead of embedding
ChrisFugl Aug 19, 2022
06b52fa
custom test_loss_computation
ChrisFugl Aug 19, 2022
adc56a5
Move get_int_dtype inline.
ChrisFugl Aug 22, 2022
64bc4fa
Make relative_position_matrix function as inline code.
ChrisFugl Aug 22, 2022
afacd00
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 22, 2022
e45af6a
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 23, 2022
bf328fd
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 23, 2022
be2881f
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 23, 2022
937b4be
Add extended docstring
ChrisFugl Aug 23, 2022
41c5231
Use integer division
ChrisFugl Aug 23, 2022
e24035f
Ignore position_ids from PyTorch model
ChrisFugl Aug 23, 2022
f0c8fea
embedding layers
ChrisFugl Aug 11, 2022
0a6602e
pretrained model superclass
ChrisFugl Aug 11, 2022
c771190
self-attention layer
ChrisFugl Aug 11, 2022
4859c82
self-output layer
ChrisFugl Aug 11, 2022
9f3de75
attention layer
ChrisFugl Aug 11, 2022
cda7e40
intermediate layer
ChrisFugl Aug 11, 2022
faa6bc0
output layer
ChrisFugl Aug 11, 2022
d6e2f70
"encoder layer" layer
ChrisFugl Aug 11, 2022
a4de6f1
add encoder
ChrisFugl Aug 11, 2022
fae22b0
add main layer
ChrisFugl Aug 11, 2022
5dd6f3e
add model
ChrisFugl Aug 11, 2022
ae1f7c9
add checkmark in support tables
ChrisFugl Aug 11, 2022
f446021
add contributors githubs
ChrisFugl Aug 11, 2022
ad40748
TensorFlow documentation
ChrisFugl Aug 11, 2022
3d5a049
add tf-layoutlmv3 to documentation tests
ChrisFugl Aug 11, 2022
a7b0d8d
Add token- and sequence classification models.
EtcEc Aug 11, 2022
23df6c7
TFLayoutLMv3ForQuestionAnswering
lre Aug 11, 2022
3539f39
add imports to model init file
ChrisFugl Aug 11, 2022
0244259
add imports to transformers init file
ChrisFugl Aug 11, 2022
0947c32
add tf layoutlmv3 entries to auto model
ChrisFugl Aug 11, 2022
07536ed
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
860c4f0
output hidden states of last layer
ChrisFugl Aug 12, 2022
e24c32d
auto styling
ChrisFugl Aug 15, 2022
a7aa12b
fix-copies
ChrisFugl Aug 15, 2022
f896881
typo of layoutlmv3 (was wrongly typed as layoutlm3)
ChrisFugl Aug 15, 2022
8775c63
Fix typo: "V3" --> "v3"
ChrisFugl Aug 16, 2022
a86291a
Add skeleton for tests
ChrisFugl Aug 16, 2022
a8377eb
Add support for both int32 and int64 inputs
ChrisFugl Aug 16, 2022
5da4229
Add huggingface profile links
ChrisFugl Aug 17, 2022
e15a2ad
Test output shapes of various model types.
ChrisFugl Aug 17, 2022
1a0c359
Add integration test
ChrisFugl Aug 17, 2022
d1ab7ae
make style
ChrisFugl Aug 17, 2022
b3c0889
make quality
ChrisFugl Aug 17, 2022
75cc112
Check init consistency
ChrisFugl Aug 18, 2022
4a0675e
Remove debug print statements.
ChrisFugl Aug 18, 2022
f9a49cd
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
abe5c35
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
88a53da
Remove shape_list dependency
ChrisFugl Aug 19, 2022
efae185
Explicit naming of shape comments
ChrisFugl Aug 19, 2022
88b0803
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
91d1f15
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
d29bbfd
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
5b75ad8
Use LARGE_NEGATIVE instead of tf.experimental
ChrisFugl Aug 19, 2022
624c066
Remove superfluous else statements
ChrisFugl Aug 19, 2022
64bc29c
Move get_int_dtype outside of the class
ChrisFugl Aug 19, 2022
3f053c8
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
287a3f9
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
f912900
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
3dec3ac
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
91f2409
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
a0717af
Update tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
cdb4cdc
Add return types
ChrisFugl Aug 19, 2022
3ae8a14
one-hot + dense instead of embedding
ChrisFugl Aug 19, 2022
eb23244
custom test_loss_computation
ChrisFugl Aug 19, 2022
3022ee7
Move get_int_dtype inline.
ChrisFugl Aug 22, 2022
0e242fe
Make relative_position_matrix function as inline code.
ChrisFugl Aug 22, 2022
0384eeb
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 23, 2022
1a1eace
Add extended docstring
ChrisFugl Aug 23, 2022
eca932e
Use integer division
ChrisFugl Aug 23, 2022
79ac465
Ignore position_ids from PyTorch model
ChrisFugl Aug 23, 2022
cecd6f4
Implicit zeros initialization
ChrisFugl Aug 24, 2022
2fff986
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 24, 2022
3d2fc5a
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
73328c4
fix-copies
ChrisFugl Aug 15, 2022
e954136
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
366ed22
Add pixel_values type hint
ChrisFugl Aug 25, 2022
4e68953
Merge remote-tracking branch 'upstream/main' into add_tf_layoutlmv3
ChrisFugl Aug 25, 2022
b2aa40b
Remove whitespace
ChrisFugl Aug 26, 2022
c333020
Remove duplicate dummy objects
ChrisFugl Aug 26, 2022
25f9149
embedding layers
ChrisFugl Aug 11, 2022
ce15146
pretrained model superclass
ChrisFugl Aug 11, 2022
d1ddb6d
self-attention layer
ChrisFugl Aug 11, 2022
a69d345
self-output layer
ChrisFugl Aug 11, 2022
8c44eb1
attention layer
ChrisFugl Aug 11, 2022
43f58cc
intermediate layer
ChrisFugl Aug 11, 2022
8999d2a
output layer
ChrisFugl Aug 11, 2022
c78a577
"encoder layer" layer
ChrisFugl Aug 11, 2022
9431117
add encoder
ChrisFugl Aug 11, 2022
e2763e5
add main layer
ChrisFugl Aug 11, 2022
f9a6808
add model
ChrisFugl Aug 11, 2022
e2941fe
add checkmark in support tables
ChrisFugl Aug 11, 2022
73fef45
add contributors githubs
ChrisFugl Aug 11, 2022
b97e52d
TensorFlow documentation
ChrisFugl Aug 11, 2022
833c367
add tf-layoutlmv3 to documentation tests
ChrisFugl Aug 11, 2022
a111290
Add token- and sequence classification models.
EtcEc Aug 11, 2022
5f25a33
TFLayoutLMv3ForQuestionAnswering
lre Aug 11, 2022
12896c5
add imports to model init file
ChrisFugl Aug 11, 2022
97a9e58
add imports to transformers init file
ChrisFugl Aug 11, 2022
b770bab
add tf layoutlmv3 entries to auto model
ChrisFugl Aug 11, 2022
d289bd7
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
c962fdc
output hidden states of last layer
ChrisFugl Aug 12, 2022
620aa36
auto styling
ChrisFugl Aug 15, 2022
1cd30e5
fix-copies
ChrisFugl Aug 15, 2022
936ae4d
typo of layoutlmv3 (was wrongly typed as layoutlm3)
ChrisFugl Aug 15, 2022
e12ec2e
Fix typo: "V3" --> "v3"
ChrisFugl Aug 16, 2022
05291b7
Add skeleton for tests
ChrisFugl Aug 16, 2022
c32aca9
Add support for both int32 and int64 inputs
ChrisFugl Aug 16, 2022
cf418ac
Add huggingface profile links
ChrisFugl Aug 17, 2022
37b9bd2
Test output shapes of various model types.
ChrisFugl Aug 17, 2022
2c85e12
Add integration test
ChrisFugl Aug 17, 2022
9a41cb3
make style
ChrisFugl Aug 17, 2022
b60107e
make quality
ChrisFugl Aug 17, 2022
4bcb2b5
Check init consistency
ChrisFugl Aug 18, 2022
62c63b5
Remove debug print statements.
ChrisFugl Aug 18, 2022
68ff217
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
84afb39
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
087ed90
Remove shape_list dependency
ChrisFugl Aug 19, 2022
137dc00
Explicit naming of shape comments
ChrisFugl Aug 19, 2022
1c3f566
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
8ae53bc
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
9aa840c
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
c552df7
Use LARGE_NEGATIVE instead of tf.experimental
ChrisFugl Aug 19, 2022
c1b6c52
Remove superfluous else statements
ChrisFugl Aug 19, 2022
997c140
Move get_int_dtype outside of the class
ChrisFugl Aug 19, 2022
c671622
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
7ea260f
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
a694cfa
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
d0e4e15
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
ebdbf0b
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
f41661c
Update tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
2b05471
Add return types
ChrisFugl Aug 19, 2022
a57c317
one-hot + dense instead of embedding
ChrisFugl Aug 19, 2022
9a53d24
custom test_loss_computation
ChrisFugl Aug 19, 2022
3aab21b
Move get_int_dtype inline.
ChrisFugl Aug 22, 2022
9d07f17
Make relative_position_matrix function as inline code.
ChrisFugl Aug 22, 2022
239120e
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 23, 2022
1168538
Add extended docstring
ChrisFugl Aug 23, 2022
36f623a
Use integer division
ChrisFugl Aug 23, 2022
82e6254
Ignore position_ids from PyTorch model
ChrisFugl Aug 23, 2022
02033d6
Implicit zeros initialization
ChrisFugl Aug 24, 2022
83cadb0
embedding layers
ChrisFugl Aug 11, 2022
f842ae3
pretrained model superclass
ChrisFugl Aug 11, 2022
268007c
self-attention layer
ChrisFugl Aug 11, 2022
69a1c72
self-output layer
ChrisFugl Aug 11, 2022
5d660c7
attention layer
ChrisFugl Aug 11, 2022
28af6c9
intermediate layer
ChrisFugl Aug 11, 2022
47f4d16
output layer
ChrisFugl Aug 11, 2022
5725a5f
"encoder layer" layer
ChrisFugl Aug 11, 2022
4e51eb0
add encoder
ChrisFugl Aug 11, 2022
1bc193e
add main layer
ChrisFugl Aug 11, 2022
a52eeb1
add model
ChrisFugl Aug 11, 2022
f317bb7
Add token- and sequence classification models.
EtcEc Aug 11, 2022
1bce29e
TFLayoutLMv3ForQuestionAnswering
lre Aug 11, 2022
08344bd
add imports to model init file
ChrisFugl Aug 11, 2022
df801b1
add tf layoutlmv3 entries to auto model
ChrisFugl Aug 11, 2022
1cea016
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
92ca018
output hidden states of last layer
ChrisFugl Aug 12, 2022
31abb7c
auto styling
ChrisFugl Aug 15, 2022
591ee5b
fix-copies
ChrisFugl Aug 15, 2022
90d439c
typo of layoutlmv3 (was wrongly typed as layoutlm3)
ChrisFugl Aug 15, 2022
f243b2d
Fix typo: "V3" --> "v3"
ChrisFugl Aug 16, 2022
62d0c20
Add skeleton for tests
ChrisFugl Aug 16, 2022
604a351
Add support for both int32 and int64 inputs
ChrisFugl Aug 16, 2022
8a65256
Test output shapes of various model types.
ChrisFugl Aug 17, 2022
74a78ec
Add integration test
ChrisFugl Aug 17, 2022
c3af32c
make style
ChrisFugl Aug 17, 2022
a9f8a19
make quality
ChrisFugl Aug 17, 2022
834838f
Check init consistency
ChrisFugl Aug 18, 2022
c2be8f4
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
97644ff
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
b52783d
Remove shape_list dependency
ChrisFugl Aug 19, 2022
8963114
Explicit naming of shape comments
ChrisFugl Aug 19, 2022
7a718dc
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
03f6cd7
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
bf42ec1
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
45ef827
Use LARGE_NEGATIVE instead of tf.experimental
ChrisFugl Aug 19, 2022
a445684
Remove superfluous else statements
ChrisFugl Aug 19, 2022
f47be23
Move get_int_dtype outside of the class
ChrisFugl Aug 19, 2022
ac195d0
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
d90c194
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
040d842
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
1655bb3
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
1153f05
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
7c2bfa5
Update tests/models/layoutlmv3/test_modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
dceb341
Add return types
ChrisFugl Aug 19, 2022
fff0e9f
one-hot + dense instead of embedding
ChrisFugl Aug 19, 2022
ff3ec9b
custom test_loss_computation
ChrisFugl Aug 19, 2022
963ace9
Move get_int_dtype inline.
ChrisFugl Aug 22, 2022
1c17b1b
Make relative_position_matrix function as inline code.
ChrisFugl Aug 22, 2022
e96369d
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 23, 2022
9d7e2e9
Add extended docstring
ChrisFugl Aug 23, 2022
8a82be8
Use integer division
ChrisFugl Aug 23, 2022
05467db
Ignore position_ids from PyTorch model
ChrisFugl Aug 23, 2022
d6724dd
dummy tf objects for layoutlmv3
ChrisFugl Aug 11, 2022
f648a49
fix-copies
ChrisFugl Aug 15, 2022
baa75df
Update src/transformers/models/layoutlmv3/modeling_tf_layoutlmv3.py
ChrisFugl Aug 19, 2022
da7953a
Add pixel_values type hint
ChrisFugl Aug 25, 2022
69a8b79
Remove whitespace
ChrisFugl Aug 26, 2022
fe145b6
Remove duplicate dummy objects
ChrisFugl Aug 26, 2022
4ac174a
Merge branch 'add_tf_layoutlmv3' of github.com:ChrisFugl/transformers…
ChrisFugl Aug 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/en/index.mdx
Expand Up @@ -38,7 +38,7 @@ The documentation is organized in five parts:
- **GET STARTED** contains a quick tour and installation instructions to get up and running with 🤗 Transformers.
- **TUTORIALS** are a great place to begin if you are new to our library. This section will help you gain the basic skills you need to start using 🤗 Transformers.
- **HOW-TO GUIDES** will show you how to achieve a specific goal like fine-tuning a pretrained model for language modeling or how to create a custom model head.
- **CONCEPTUAL GUIDES** provides more discussion and explanation of the underlying concepts and ideas behind models, tasks, and the design philosophy of 🤗 Transformers.
- **CONCEPTUAL GUIDES** provides more discussion and explanation of the underlying concepts and ideas behind models, tasks, and the design philosophy of 🤗 Transformers.
- **API** describes each class and function, grouped in:

- **MAIN CLASSES** for the main classes exposing the important APIs of the library.
Expand Down Expand Up @@ -245,7 +245,7 @@ Flax), PyTorch, and/or TensorFlow.
| ImageGPT | ❌ | ❌ | ✅ | ❌ | ❌ |
| LayoutLM | ✅ | ✅ | ✅ | ✅ | ❌ |
| LayoutLMv2 | ✅ | ✅ | ✅ | ❌ | ❌ |
| LayoutLMv3 | ✅ | ✅ | ✅ | | ❌ |
| LayoutLMv3 | ✅ | ✅ | ✅ | | ❌ |
| LED | ✅ | ✅ | ✅ | ✅ | ❌ |
| LeViT | ❌ | ❌ | ✅ | ❌ | ❌ |
| Longformer | ✅ | ✅ | ✅ | ✅ | ❌ |
Expand Down
28 changes: 24 additions & 4 deletions docs/source/en/model_doc/layoutlmv3.mdx
Expand Up @@ -26,18 +26,18 @@ Tips:

- In terms of data processing, LayoutLMv3 is identical to its predecessor [LayoutLMv2](layoutlmv2), except that:
- images need to be resized and normalized with channels in regular RGB format. LayoutLMv2 on the other hand normalizes the images internally and expects the channels in BGR format.
- text is tokenized using byte-pair encoding (BPE), as opposed to WordPiece.
- text is tokenized using byte-pair encoding (BPE), as opposed to WordPiece.
Due to these differences in data preprocessing, one can use [`LayoutLMv3Processor`] which internally combines a [`LayoutLMv3FeatureExtractor`] (for the image modality) and a [`LayoutLMv3Tokenizer`]/[`LayoutLMv3TokenizerFast`] (for the text modality) to prepare all data for the model.
- Regarding usage of [`LayoutLMv3Processor`], we refer to the [usage guide](layoutlmv2#usage-layoutlmv2processor) of its predecessor.
- Regarding usage of [`LayoutLMv3Processor`], we refer to the [usage guide](layoutlmv2#usage-layoutlmv2processor) of its predecessor.
- Demo notebooks for LayoutLMv3 can be found [here](https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LayoutLMv3).
- Demo scripts can be found [here](https://github.com/huggingface/transformers/tree/main/examples/research_projects/layoutlmv3).

<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/layoutlmv3_architecture.png"
alt="drawing" width="600"/>
alt="drawing" width="600"/>

<small> LayoutLMv3 architecture. Taken from the <a href="https://arxiv.org/abs/2204.08387">original paper</a>. </small>

This model was contributed by [nielsr](https://huggingface.co/nielsr). The original code can be found [here](https://github.com/microsoft/unilm/tree/master/layoutlmv3).
This model was contributed by [nielsr](https://huggingface.co/nielsr). The TensorFlow version of this model was added by [chriskoo](https://huggingface.co/chriskoo), [tokec](https://huggingface.co/tokec), and [lre](https://huggingface.co/lre). The original code can be found [here](https://github.com/microsoft/unilm/tree/master/layoutlmv3).


## LayoutLMv3Config
Expand Down Expand Up @@ -84,3 +84,23 @@ This model was contributed by [nielsr](https://huggingface.co/nielsr). The origi

[[autodoc]] LayoutLMv3ForQuestionAnswering
- forward

## TFLayoutLMv3Model

[[autodoc]] TFLayoutLMv3Model
- call

## TFLayoutLMv3ForSequenceClassification

[[autodoc]] TFLayoutLMv3ForSequenceClassification
- call

## TFLayoutLMv3ForTokenClassification

[[autodoc]] TFLayoutLMv3ForTokenClassification
- call

## TFLayoutLMv3ForQuestionAnswering

[[autodoc]] TFLayoutLMv3ForQuestionAnswering
- call
4 changes: 2 additions & 2 deletions docs/source/it/index.mdx
Expand Up @@ -221,7 +221,7 @@ tokenizer (chiamato "slow"). Un tokenizer "fast" supportato dalla libreria 🤗
| ImageGPT | ❌ | ❌ | ✅ | ❌ | ❌ |
| LayoutLM | ✅ | ✅ | ✅ | ✅ | ❌ |
| LayoutLMv2 | ✅ | ✅ | ✅ | ❌ | ❌ |
| LayoutLMv3 | ✅ | ✅ | ✅ | | ❌ |
| LayoutLMv3 | ✅ | ✅ | ✅ | | ❌ |
ChrisFugl marked this conversation as resolved.
Show resolved Hide resolved
| LED | ✅ | ✅ | ✅ | ✅ | ❌ |
| Longformer | ✅ | ✅ | ✅ | ✅ | ❌ |
| LUKE | ✅ | ❌ | ✅ | ❌ | ❌ |
Expand Down Expand Up @@ -288,4 +288,4 @@ tokenizer (chiamato "slow"). Un tokenizer "fast" supportato dalla libreria 🤗
| YOLOS | ❌ | ❌ | ✅ | ❌ | ❌ |
| YOSO | ❌ | ❌ | ✅ | ❌ | ❌ |

<!-- End table-->
<!-- End table-->
18 changes: 18 additions & 0 deletions src/transformers/__init__.py
Expand Up @@ -2343,6 +2343,16 @@
"TFLayoutLMPreTrainedModel",
]
)
_import_structure["models.layoutlmv3"].extend(
[
"TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST",
"TFLayoutLMv3ForQuestionAnswering",
"TFLayoutLMv3ForSequenceClassification",
"TFLayoutLMv3ForTokenClassification",
"TFLayoutLMv3Model",
"TFLayoutLMv3PreTrainedModel",
]
)
_import_structure["models.led"].extend(["TFLEDForConditionalGeneration", "TFLEDModel", "TFLEDPreTrainedModel"])
_import_structure["models.longformer"].extend(
[
Expand Down Expand Up @@ -4793,6 +4803,14 @@
TFHubertModel,
TFHubertPreTrainedModel,
)
from .models.layoutlmv3 import (
TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST,
TFLayoutLMv3ForQuestionAnswering,
TFLayoutLMv3ForSequenceClassification,
TFLayoutLMv3ForTokenClassification,
TFLayoutLMv3Model,
TFLayoutLMv3PreTrainedModel,
)
from .models.led import TFLEDForConditionalGeneration, TFLEDModel, TFLEDPreTrainedModel
from .models.longformer import (
TF_LONGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
Expand Down
5 changes: 5 additions & 0 deletions src/transformers/models/auto/modeling_tf_auto.py
Expand Up @@ -52,6 +52,7 @@
("gptj", "TFGPTJModel"),
("hubert", "TFHubertModel"),
("layoutlm", "TFLayoutLMModel"),
("layoutlmv3", "TFLayoutLMv3Model"),
("led", "TFLEDModel"),
("longformer", "TFLongformerModel"),
("lxmert", "TFLxmertModel"),
Expand Down Expand Up @@ -266,6 +267,7 @@
("gpt2", "TFGPT2ForSequenceClassification"),
("gptj", "TFGPTJForSequenceClassification"),
("layoutlm", "TFLayoutLMForSequenceClassification"),
("layoutlmv3", "TFLayoutLMv3ForSequenceClassification"),
("longformer", "TFLongformerForSequenceClassification"),
("mobilebert", "TFMobileBertForSequenceClassification"),
("mpnet", "TFMPNetForSequenceClassification"),
Expand Down Expand Up @@ -295,6 +297,7 @@
("flaubert", "TFFlaubertForQuestionAnsweringSimple"),
("funnel", "TFFunnelForQuestionAnswering"),
("gptj", "TFGPTJForQuestionAnswering"),
("layoutlmv3", "TFLayoutLMv3ForQuestionAnswering"),
("longformer", "TFLongformerForQuestionAnswering"),
("mobilebert", "TFMobileBertForQuestionAnswering"),
("mpnet", "TFMPNetForQuestionAnswering"),
Expand All @@ -307,6 +310,7 @@
]
)


ChrisFugl marked this conversation as resolved.
Show resolved Hide resolved
TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES = OrderedDict(
[
# Model for Table Question Answering mapping
Expand All @@ -329,6 +333,7 @@
("flaubert", "TFFlaubertForTokenClassification"),
("funnel", "TFFunnelForTokenClassification"),
("layoutlm", "TFLayoutLMForTokenClassification"),
("layoutlmv3", "TFLayoutLMv3ForTokenClassification"),
("longformer", "TFLongformerForTokenClassification"),
("mobilebert", "TFMobileBertForTokenClassification"),
("mpnet", "TFMPNetForTokenClassification"),
Expand Down
31 changes: 31 additions & 0 deletions src/transformers/models/layoutlmv3/__init__.py
Expand Up @@ -21,6 +21,7 @@
from ...utils import (
OptionalDependencyNotAvailable,
_LazyModule,
is_tf_available,
is_tokenizers_available,
is_torch_available,
is_vision_available,
Expand Down Expand Up @@ -60,6 +61,21 @@
"LayoutLMv3PreTrainedModel",
]

try:
if not is_tf_available():
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
pass
else:
_import_structure["modeling_tf_layoutlmv3"] = [
"TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST",
"TFLayoutLMv3ForQuestionAnswering",
"TFLayoutLMv3ForSequenceClassification",
"TFLayoutLMv3ForTokenClassification",
"TFLayoutLMv3Model",
"TFLayoutLMv3PreTrainedModel",
]

try:
if not is_vision_available():
raise OptionalDependencyNotAvailable()
Expand Down Expand Up @@ -101,6 +117,21 @@
LayoutLMv3PreTrainedModel,
)

try:
if not is_tf_available():
raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
pass
else:
from .modeling_tf_layoutlmv3 import (
TF_LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST,
TFLayoutLMv3ForQuestionAnswering,
TFLayoutLMv3ForSequenceClassification,
TFLayoutLMv3ForTokenClassification,
TFLayoutLMv3Model,
TFLayoutLMv3PreTrainedModel,
)

try:
if not is_vision_available():
raise OptionalDependencyNotAvailable()
Expand Down