Views
No views yet

gliner-large-v2.1-bird model, a fine-tuned version of the GLiNER gliner_large-v2.1 targeting specific types of data related to the descriptions of birds. This model enhances the capability to recognize detailed aspects of avian life, particularly focusing on their nesting and dietary habits.gliner-large-v2.1-bird model is fine-tuned on synthetic data specifically created to capture the nuances of avian dietary and nesting behaviors. The original model, available at GLiNER GitHub, has been adapted to better understand texts describing birds, by recognizing and categorizing specific labels related to food sources and nesting locations.1{
2 "text": "The Alpine Swift primarily consumes flying insects such as wasps, bees, and flies. This bird captures its prey mid-air while swiftly flying through the alpine skies. It nests in high, rocky mountain crevices where it uses feathers and small sticks to construct a simple yet secure nesting environment.",
3 "generic_plant_food": [],
4 "generic_animal_food": ["flying insects"],
5 "plant_food": [],
6 "specific_animal_food": [
7 "wasps",
8 "bees",
9 "flies"
10 ],
11 "location_nest": [
12 "rocky mountain crevices"
13 ],
14 "item_nest": [
15 "feathers",
16 "small sticks"
17 ]
18}!pip install gliner1from gliner import GLiNER
2
3# Initialize GLiNER with the fine-tuned model
4model = GLiNER.from_pretrained("wjbmattingly/gliner-large-v2.1-bird")
5
6# Sample text for entity prediction
7text = """
8The Alpine Swift primarily consumes flying insects such as wasps, bees, and flies. This bird captures its prey mid-air while swiftly flying through the alpine skies. It nests in high, rocky mountain crevices where it uses feathers and small sticks to construct a simple yet secure nesting environment.
9"""
10
11# Labels for entity prediction (ensure to use the labels specific to your model's training)
12labels = ["GENERIC_PLANT_FOOD", "GENERIC_ANIMAL_FOOD", "PLANT_FOOD", "SPECIFIC_ANIMAL_FOOD", "LOCATION_NEST", "ITEM_NEST"]
13
14# Perform entity prediction
15entities = model.predict_entities(text, labels, threshold=0.5)
16
17# Display predicted entities and their labels
18for entity in entities:
19 print(entity["text"], "=>", entity["label"])