feat: stage NLI-MiniLM2 experimental candidate
Browse files- README.md +20 -0
- manifest.json +70 -0
- nli-minilm2-l6-h768/LICENSE +202 -0
- nli-minilm2-l6-h768/UPSTREAM_README.md +69 -0
- nli-minilm2-l6-h768/config.json +36 -0
- nli-minilm2-l6-h768/merges.txt +0 -0
- nli-minilm2-l6-h768/model.onnx +3 -0
- nli-minilm2-l6-h768/model_qint8_arm64.onnx +3 -0
- nli-minilm2-l6-h768/model_quint8_avx2.onnx +3 -0
- nli-minilm2-l6-h768/special_tokens_map.json +1 -0
- nli-minilm2-l6-h768/tokenizer.json +0 -0
- nli-minilm2-l6-h768/tokenizer_config.json +1 -0
- nli-minilm2-l6-h768/vocab.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- onnx
|
| 5 |
+
- xberg
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# Classification Models (experimental candidates)
|
| 9 |
+
|
| 10 |
+
Unmodified copies of permissively licensed upstream ONNX exports, staged by [xberg](https://github.com/xberg-io/xberg) for evaluation (xberg-io/xberg#2334, #2336). **Experimental candidates, not qualified**: no model here is an xberg default, a supported preset or a bundling decision.
|
| 11 |
+
|
| 12 |
+
| Directory | Upstream | Upstream revision | License | Task |
|
| 13 |
+
|---|---|---|---|---|
|
| 14 |
+
| `nli-minilm2-l6-h768` | [cross-encoder/nli-MiniLM2-L6-H768](https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768) | `b95119ce93d3e065de6214e38cd4a97b0f2f2c6d` | Apache-2.0 | zero-shot / NLI classification (3-way logits: 0 contradiction, 1 entailment, 2 neutral) |
|
| 15 |
+
|
| 16 |
+
Every directory keeps the upstream `LICENSE` text (`LICENSE`), the upstream model card (`UPSTREAM_README.md`), tokenizer, processor and generation configuration, and all graphs the pipeline needs. `manifest.json` lists the SHA-256 and size of every file and the upstream revision it was copied from. Consumers must pin this repository's commit revision (recorded in `crates/xberg/src/candidate_models/`) and verify the SHA-256 values; do not resolve `main`.
|
| 17 |
+
|
| 18 |
+
Attribution: each model remains the work of its upstream authors under the license listed above. Notes per model:
|
| 19 |
+
|
| 20 |
+
- `nli-minilm2-l6-h768`: RoBERTa-tokenizer MiniLMv2 cross-encoder; fp32 plus arm64 qint8 and avx2 quint8 dynamic quantizations as published upstream. Base model nreimers/MiniLMv2-L6-H768-distilled-from-RoBERTa-Large declares no license on its card (microsoft/unilm origin, MIT); the cross-encoder itself declares Apache-2.0.
|
manifest.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"note": "Experimental candidate artifacts, not qualified. Weights unmodified copies of the pinned upstream revisions; every file sha256-pinned.",
|
| 3 |
+
"models": {
|
| 4 |
+
"nli-minilm2-l6-h768": {
|
| 5 |
+
"upstream": "https://huggingface.co/cross-encoder/nli-MiniLM2-L6-H768",
|
| 6 |
+
"upstream_revision": "b95119ce93d3e065de6214e38cd4a97b0f2f2c6d",
|
| 7 |
+
"license": "Apache-2.0",
|
| 8 |
+
"task": "zero-shot / NLI classification (3-way logits: 0 contradiction, 1 entailment, 2 neutral)",
|
| 9 |
+
"notes": "RoBERTa-tokenizer MiniLMv2 cross-encoder; fp32 plus arm64 qint8 and avx2 quint8 dynamic quantizations as published upstream. Base model nreimers/MiniLMv2-L6-H768-distilled-from-RoBERTa-Large declares no license on its card (microsoft/unilm origin, MIT); the cross-encoder itself declares Apache-2.0.",
|
| 10 |
+
"status": "experimental candidate, not qualified",
|
| 11 |
+
"files": [
|
| 12 |
+
{
|
| 13 |
+
"path": "nli-minilm2-l6-h768/LICENSE",
|
| 14 |
+
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30",
|
| 15 |
+
"size_bytes": 11358
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"path": "nli-minilm2-l6-h768/UPSTREAM_README.md",
|
| 19 |
+
"sha256": "1a6e3f880df3584acc1b209c7c667eb22cb7ddd98ab56a5905dda5cfc446ddd1",
|
| 20 |
+
"size_bytes": 2695
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"path": "nli-minilm2-l6-h768/config.json",
|
| 24 |
+
"sha256": "8b0e41caff7567c0f53e6983f35591c3dec59507c9173ab125c5823394fb57f3",
|
| 25 |
+
"size_bytes": 875
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"path": "nli-minilm2-l6-h768/merges.txt",
|
| 29 |
+
"sha256": "fe36cab26d4f4421ed725e10a2e9ddb7f799449c603a96e7f29b5a3c82a95862",
|
| 30 |
+
"size_bytes": 456356
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"path": "nli-minilm2-l6-h768/model.onnx",
|
| 34 |
+
"sha256": "807d33fffefd95ad60e2a91f54eed50a92aa53c077945a6842bb587a49a3fdf3",
|
| 35 |
+
"size_bytes": 328649957
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"path": "nli-minilm2-l6-h768/model_qint8_arm64.onnx",
|
| 39 |
+
"sha256": "449024a8711a3e655cad410cb2192158f9897fc2a32b65dbb817922351150db7",
|
| 40 |
+
"size_bytes": 82823065
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"path": "nli-minilm2-l6-h768/model_quint8_avx2.onnx",
|
| 44 |
+
"sha256": "44391a5241a62e0083c1a8899a71e69a092b95aea5ba89e14062925468eceac7",
|
| 45 |
+
"size_bytes": 82823063
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"path": "nli-minilm2-l6-h768/special_tokens_map.json",
|
| 49 |
+
"sha256": "378eb3bf733eb16e65792d7e3fda5b8a4631387ca04d2015199c4d4f22ae554d",
|
| 50 |
+
"size_bytes": 239
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"path": "nli-minilm2-l6-h768/tokenizer.json",
|
| 54 |
+
"sha256": "82139106e603ee4e1d5bc99d056ccbed5a92bc24848b1b5a7137c26e00d0dbf6",
|
| 55 |
+
"size_bytes": 1356048
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"path": "nli-minilm2-l6-h768/tokenizer_config.json",
|
| 59 |
+
"sha256": "e06f5c3c435fc0255b08b5574cd574eec685390f60c85b27f83d785eb8ecaaa1",
|
| 60 |
+
"size_bytes": 330
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"path": "nli-minilm2-l6-h768/vocab.json",
|
| 64 |
+
"sha256": "ed19656ea1707df69134c4af35c8ceda2cc9860bf2c3495026153a133670ab5e",
|
| 65 |
+
"size_bytes": 798293
|
| 66 |
+
}
|
| 67 |
+
]
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
}
|
nli-minilm2-l6-h768/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
nli-minilm2-l6-h768/UPSTREAM_README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
pipeline_tag: zero-shot-classification
|
| 4 |
+
tags:
|
| 5 |
+
- transformers
|
| 6 |
+
datasets:
|
| 7 |
+
- nyu-mll/multi_nli
|
| 8 |
+
- stanfordnlp/snli
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
base_model:
|
| 13 |
+
- nreimers/MiniLMv2-L6-H768-distilled-from-RoBERTa-Large
|
| 14 |
+
library_name: sentence-transformers
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Cross-Encoder for Natural Language Inference
|
| 18 |
+
This model was trained using [SentenceTransformers](https://sbert.net) [Cross-Encoder](https://www.sbert.net/examples/applications/cross-encoder/README.html) class.
|
| 19 |
+
|
| 20 |
+
## Training Data
|
| 21 |
+
The model was trained on the [SNLI](https://nlp.stanford.edu/projects/snli/) and [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) datasets. For a given sentence pair, it will output three scores corresponding to the labels: contradiction, entailment, neutral.
|
| 22 |
+
|
| 23 |
+
## Performance
|
| 24 |
+
For evaluation results, see [SBERT.net - Pretrained Cross-Encoder](https://www.sbert.net/docs/pretrained_cross-encoders.html#nli).
|
| 25 |
+
|
| 26 |
+
## Usage
|
| 27 |
+
|
| 28 |
+
Pre-trained models can be used like this:
|
| 29 |
+
```python
|
| 30 |
+
from sentence_transformers import CrossEncoder
|
| 31 |
+
model = CrossEncoder('cross-encoder/nli-MiniLM2-L6-H768')
|
| 32 |
+
scores = model.predict([('A man is eating pizza', 'A man eats something'), ('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')])
|
| 33 |
+
|
| 34 |
+
#Convert scores to labels
|
| 35 |
+
label_mapping = ['contradiction', 'entailment', 'neutral']
|
| 36 |
+
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Usage with Transformers AutoModel
|
| 40 |
+
You can use the model also directly with Transformers library (without SentenceTransformers library):
|
| 41 |
+
```python
|
| 42 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 43 |
+
import torch
|
| 44 |
+
|
| 45 |
+
model = AutoModelForSequenceClassification.from_pretrained('cross-encoder/nli-MiniLM2-L6-H768')
|
| 46 |
+
tokenizer = AutoTokenizer.from_pretrained('cross-encoder/nli-MiniLM2-L6-H768')
|
| 47 |
+
|
| 48 |
+
features = tokenizer(['A man is eating pizza', 'A black race car starts up in front of a crowd of people.'], ['A man eats something', 'A man is driving down a lonely road.'], padding=True, truncation=True, return_tensors="pt")
|
| 49 |
+
|
| 50 |
+
model.eval()
|
| 51 |
+
with torch.no_grad():
|
| 52 |
+
scores = model(**features).logits
|
| 53 |
+
label_mapping = ['contradiction', 'entailment', 'neutral']
|
| 54 |
+
labels = [label_mapping[score_max] for score_max in scores.argmax(dim=1)]
|
| 55 |
+
print(labels)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Zero-Shot Classification
|
| 59 |
+
This model can also be used for zero-shot-classification:
|
| 60 |
+
```python
|
| 61 |
+
from transformers import pipeline
|
| 62 |
+
|
| 63 |
+
classifier = pipeline("zero-shot-classification", model='cross-encoder/nli-MiniLM2-L6-H768')
|
| 64 |
+
|
| 65 |
+
sent = "Apple just announced the newest iPhone X"
|
| 66 |
+
candidate_labels = ["technology", "sports", "politics"]
|
| 67 |
+
res = classifier(sent, candidate_labels)
|
| 68 |
+
print(res)
|
| 69 |
+
```
|
nli-minilm2-l6-h768/config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "nreimers/MiniLMv2-L6-H768-distilled-from-RoBERTa-Large",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"gradient_checkpointing": false,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"id2label": {
|
| 14 |
+
"0": "contradiction",
|
| 15 |
+
"1": "entailment",
|
| 16 |
+
"2": "neutral"
|
| 17 |
+
},
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 3072,
|
| 20 |
+
"label2id": {
|
| 21 |
+
"contradiction": 0,
|
| 22 |
+
"entailment": 1,
|
| 23 |
+
"neutral": 2
|
| 24 |
+
},
|
| 25 |
+
"layer_norm_eps": 1e-05,
|
| 26 |
+
"max_position_embeddings": 514,
|
| 27 |
+
"model_type": "roberta",
|
| 28 |
+
"num_attention_heads": 12,
|
| 29 |
+
"num_hidden_layers": 6,
|
| 30 |
+
"pad_token_id": 1,
|
| 31 |
+
"position_embedding_type": "absolute",
|
| 32 |
+
"transformers_version": "4.6.1",
|
| 33 |
+
"type_vocab_size": 1,
|
| 34 |
+
"use_cache": true,
|
| 35 |
+
"vocab_size": 50265
|
| 36 |
+
}
|
nli-minilm2-l6-h768/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
nli-minilm2-l6-h768/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:807d33fffefd95ad60e2a91f54eed50a92aa53c077945a6842bb587a49a3fdf3
|
| 3 |
+
size 328649957
|
nli-minilm2-l6-h768/model_qint8_arm64.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:449024a8711a3e655cad410cb2192158f9897fc2a32b65dbb817922351150db7
|
| 3 |
+
size 82823065
|
nli-minilm2-l6-h768/model_quint8_avx2.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44391a5241a62e0083c1a8899a71e69a092b95aea5ba89e14062925468eceac7
|
| 3 |
+
size 82823063
|
nli-minilm2-l6-h768/special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
|
nli-minilm2-l6-h768/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
nli-minilm2-l6-h768/tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "add_prefix_space": false, "errors": "replace", "sep_token": "</s>", "cls_token": "<s>", "pad_token": "<pad>", "mask_token": "<mask>", "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "nreimers/MiniLMv2-L6-H768-distilled-from-RoBERTa-Large"}
|
nli-minilm2-l6-h768/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|