Instructions to use FluidInference/gliner2-5-multi-coreml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER2
How to use FluidInference/gliner2-5-multi-coreml with GLiNER2:
from gliner2 import AutoExtractor extractor = AutoExtractor.from_pretrained("FluidInference/gliner2-5-multi-coreml") # Extract entities text = "Apple CEO Tim Cook announced iPhone 15 in Cupertino yesterday." result = extractor.extract_entities(text, ["company", "person", "product", "location"]) print(result) - Notebooks
- Google Colab
- Kaggle
File size: 824 Bytes
c6e4872 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | """Schema routing for the quantized multilingual extraction runtime."""
from gliner2 import Schema
from extraction_runtime import CoreMLAdaptiveBoundaryExtractor
def record_schema(mode: str):
schema = Schema()
schema.structure("employment", mode=mode).field("person", dtype="str").field("company", dtype="str")
return schema
def test_latent_record_uses_fp32():
assert CoreMLAdaptiveBoundaryExtractor.selected_precision(record_schema("latent")) == "fp32"
def test_other_selected_schemas_use_fp16():
assert CoreMLAdaptiveBoundaryExtractor.selected_precision(Schema().entities(["person"])) == "fp16"
assert CoreMLAdaptiveBoundaryExtractor.selected_precision(record_schema("natural")) == "fp16"
assert CoreMLAdaptiveBoundaryExtractor.selected_precision(record_schema("anchorless")) == "fp16"
|