dream

Форк
0

README.md

Property Extraction

Description

The Property Extraction annotator extracts user attributes in RDF-triplet format for a specific individual. This enables a dialog assistant to acquire information about the user’s preferred film, dish, location, etc., and utilize this knowledge to generate personalized responses.

The annotator is capable of extracting multiple user attributes from utterances in the form of (subject, predicate, object) triplets. The subject is designated as “user,” the relation represents the attribute name, and the object denotes the attribute value. There are 61 distinct relation types that the annotator currently supports, as listed in the rel_list.txt file.

Property Extraction annotator consists of the following components:

Relation classifier - a BERT-based model that finds all the user attributes in the current utterance, if there are any. Entity generator - a se2seq model which generates the subject and object for each attribute found in the previuos step.

I/O

Input Takes user utterances as a list of lists

An input example:

import requests
utterances = [["I love going for a walk with my two dogs every day."],
["I like travelling in Italy with my husband. And you?"]]
requests.post("http://0.0.0.0:8136/respond", json = {"utterances": utterances}).json()

Output Returns annotated triplets subject-relation-object with information about entities and their relations

An output example:

[
    {"triplets": [{"subject": "user", "relation": "like activity", "object": "walking"}, {"subject": "user", "relation": "have pet", "object": "two dogs"}]}, 
    {"triplets": [{"subject": "user", "property": "marital status", "object": "husband"}, {"subject": "user", "relation": "like activity", "object": "travel"}]}
    ]

Dependencies

  • annotators.ner
  • annotators.entity_linking

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.