Sign inSign up

limteng/oneie_kairos

By limteng

•Updated almost 6 years ago

Image
1

2.0K

limteng/oneie_kairos repository overview

⁠How to Run

$ cd oneie
$ python app.py --port 61802 --tmp_dir <path/to/the/dir/for/tmp/files>

⁠Input Format

To call the API, send a POST request with application/json as mimetype and a JSON format string as its data with the following fields:

{
    // Required field
    "data": [
        {
            "doc_id": "xxxx01",
            "doc_tokens": [
                [['a', 0, 1], ['sentence', 2, 10]],
                [['sentence', 11, 19], ['2', 20, 21]]
            ]
        },
        ...
    ],
    
    // Optional fields
    "lang": "en",
    "batch_size": 10,
    "max_length": 128,
    "beam_size": 10,
    "device": 0
}

The value of the data field in this JSON string is a list. Each object in the list is a document with its document ID doc_id and tokens doc_tokens. Each document should have a unique doc_id. The value of the doc_tokens field is a list of lists. Each list contains tokens of a sentence in the document, where each token is a triplet of (token_text, start_char_offset, end_char_offset).

⁠Output Format

The API returns a JSON object as follows:

{
    'oneie': {
        # OneIE's JSON format output files
        'json': {
            'doc_id_1': ...,
            'doc_id_2': ...,
            ...
        },
        # Cold-start format output files
        'cs': {
            'entity': ...,
            'relation': ...,
            'event': ...
        },
        # TAB format output files
        'tab': {
            'nam': ...,
            'nom': ...,
            'pro': ...,
            'nam+nom+pro': ...
        },
        # BIO format output files
        'bio': {
            'nam': ...,
            'nom': ...,
            'pro': ...,
            'nam+nom+pro': ...
        },
        # Fine-grained entity typing output file
        'cfet': ...
    }
}

The value of each field is the text content of the corresponding file.

Tag summary

Content type

Image

Digest

Size

10.9 GB

Last updated

almost 6 years ago

docker pull limteng/oneie_kairos