Skip to content

Why I am getting single entity #528

@shivshankarkeshari

Description

@shivshankarkeshari

below is my define yaml file

id: https://example.org/general_template
name: general_template
description: A high-level description of what kind of entity this is, with support for inter-entity relationships.
prefixes:
  ex: https://example.org/
default_prefix: ex
imports:
  - linkml:types
  - core


classes:
  ExtractionResult:
    description: The root class for a collection of extracted entities.
    tree_root: true
    slots:
      - entities

  EntityName:
    description: A generic entity with key-value attributes and inter-entity relationships
    slots:
      - name
      - description
      - type
      - attributes
      - relationships

  Attribute:
    description: A key-value property of the entity (e.g., Industry, Role)
    slots:
      - key
      - value

  Relationship:
    description: A relationship between two entities in describe what they are related to
    slots:
      - target
      - rel_type

slots:
  
  # Slots for ExtractionResult class
  entities:
    description: A list of extracted entities.
    range: EntityName
    multivalued: true
  
  # Slots for EntityName class
  name:
    description: The name or label of the entity
    range: string
    required: true

  description:
    description: A detailed description of the entity 
    range: string

  type:
    description: Category or type of entity (e.g., Company, Person, Product)
    range: string
  
  attributes:
    description: List of key-value attribute pairs describing the entity
    multivalued: true
    range: Attribute
  
  relationships:
    description: Relationships from this entity to other entities in describe what they are related to
    multivalued: true
    range: Relationship
  
  # Slots for Attribute class
  key:
    description: The property name (e.g., Industry, Role)
    range: string
    required: true

  value:
    description: The property value
    range: string
    required: true
  
  # Slots for Relationship class
  target:
    description: The name or identifier of the target entity
    range: string
    required: true

  rel_type: # Renamed from 'type' to 'rel_type'
    description: The relationship type
    range: string
    required: true


for below input

"""
Tesla is a company that manufactures electric vehicles. Elon Musk is the CEO of Tesla.
The Model S is a premium electric car. It uses lithium-ion batteries and has autopilot features.
"""

output

{
  "input_id": null,
  "input_title": null,
  "input_text": "\nTesla is a company that manufactures electric vehicles. Elon Musk is the CEO of Tesla.\nThe Model S is a premium electric car. It uses lithium-ion batteries and has autopilot features.\n",
  "raw_completion_output": "entities: [\"Tesla\", \"electric vehicles\", \"Elon Musk\", \"CEO\", \"Model S\", \"premium electric car\", \"lithium-ion batteries\", \"autopilot features\"]",
  "prompt": "From the text below, extract the following entities in the following format:\n\nname: <The name or label of the entity>\ndescription: <A detailed description of the entity>\ntype: <Category or type of entity (e.g., Company, Person, Product)>\nattributes: <List of key-value attribute pairs describing the entity>\nrelationships: <Relationships from this entity to other entities in describe what they are related to>\n\n\nText:\n[Tesla, electric vehicles, Elon Musk, CEO, Model S, premium electric car, lithium-ion batteries, autopilot features]\n\n===\n\n",
  "extracted_object": {
    "entities": [
      {
        "name": "Autopilot features",
        "description": "Advanced driver-assistance technologies integrated into Tesla vehicles like the Model S for semi-autonomous driving.",
        "type": "Technology/Feature",
        "attributes": null,
        "relationships": null
      }
    ]
  },
  "named_entities": []
}

I am unable to understand why am I not getting 8 extracted_object in entities. also why attributes and relationships is null, How can I fix? Anyone help would be very helpful for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions