Question Answering
Transformers
ONNX
Safetensors
nullspan
feature-extraction
system-one
typed-decisions
jevbench
structured-extraction
span-extraction
calibrated-estimation
electra
modernbert
custom_code
Eval Results
Instructions to use gnumanth/nullspan with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gnumanth/nullspan with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="gnumanth/nullspan", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gnumanth/nullspan", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Release v1.1.0: 512-token sliding window + multi-numeric contract disambiguation
Browse files- config.json +1 -0
- modeling_nullspan.py +3 -1
- onnx/model.onnx +1 -1
config.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
| 10 |
"dropout": 0.1,
|
| 11 |
"dtype": "float32",
|
| 12 |
"hidden_size": 768,
|
|
|
|
| 13 |
"model_type": "nullspan",
|
| 14 |
"null_temperature": 1.0,
|
| 15 |
"num_bio_labels": 3,
|
|
|
|
| 10 |
"dropout": 0.1,
|
| 11 |
"dtype": "float32",
|
| 12 |
"hidden_size": 768,
|
| 13 |
+
"max_length": 512,
|
| 14 |
"model_type": "nullspan",
|
| 15 |
"null_temperature": 1.0,
|
| 16 |
"num_bio_labels": 3,
|
modeling_nullspan.py
CHANGED
|
@@ -33,6 +33,7 @@ class NullspanConfig(PretrainedConfig):
|
|
| 33 |
dropout: float = 0.1,
|
| 34 |
null_temperature: float = 1.0,
|
| 35 |
span_temperature: float = 1.0,
|
|
|
|
| 36 |
**kwargs: Any,
|
| 37 |
) -> None:
|
| 38 |
super().__init__(**kwargs)
|
|
@@ -43,6 +44,7 @@ class NullspanConfig(PretrainedConfig):
|
|
| 43 |
self.dropout = dropout
|
| 44 |
self.null_temperature = null_temperature
|
| 45 |
self.span_temperature = span_temperature
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
def format_field_query(field_name: str, spec: dict[str, Any]) -> str:
|
|
@@ -51,7 +53,7 @@ def format_field_query(field_name: str, spec: dict[str, Any]) -> str:
|
|
| 51 |
items = spec.get("items", "")
|
| 52 |
options = spec.get("options", [])
|
| 53 |
constraint = spec.get("constraint", "")
|
| 54 |
-
instr = spec.get("instructions"
|
| 55 |
parts = [f"field: {field_name}", f"type: {ftype}"]
|
| 56 |
if unit:
|
| 57 |
parts.append(f"unit: {unit}")
|
|
|
|
| 33 |
dropout: float = 0.1,
|
| 34 |
null_temperature: float = 1.0,
|
| 35 |
span_temperature: float = 1.0,
|
| 36 |
+
max_length: int = 512,
|
| 37 |
**kwargs: Any,
|
| 38 |
) -> None:
|
| 39 |
super().__init__(**kwargs)
|
|
|
|
| 44 |
self.dropout = dropout
|
| 45 |
self.null_temperature = null_temperature
|
| 46 |
self.span_temperature = span_temperature
|
| 47 |
+
self.max_length = max_length
|
| 48 |
|
| 49 |
|
| 50 |
def format_field_query(field_name: str, spec: dict[str, Any]) -> str:
|
|
|
|
| 53 |
items = spec.get("items", "")
|
| 54 |
options = spec.get("options", [])
|
| 55 |
constraint = spec.get("constraint", "")
|
| 56 |
+
instr = spec.get("instructions") or spec.get("instruction") or ""
|
| 57 |
parts = [f"field: {field_name}", f"type: {ftype}"]
|
| 58 |
if unit:
|
| 59 |
parts.append(f"unit: {unit}")
|
onnx/model.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 268359123
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b55c69bca6eaca11c9ee9a44e7410c061f287c54d2af4db42a13424404a03217
|
| 3 |
size 268359123
|