Default BERT Textual Entailment Service Documentation

Introduction

This application provides an implementation of BART fine-tuned on NLI dataset for indetifying argument relations. It serves as a default AMF component designed for detecting argument relations between propositions. Entailemtnt relation is mapped to support relation, conflicts, and non-relations between propositions. - It can be integrated into the argument mining pipeline alongside other AMF components for further analysis and processing.

Brief Overview of the Architecture/Method

Brief overview of the architecture/method used.

Endpoints

/bert-te

Description

Details

Input and Output Formats

Input Format

Output Format

The inferred argument structure is returned in the xAIF format, containing nodes, edges, locutions, and other relevant information. In the xAIF: - Argument units are specified as type "I" nodes. - Argument relations are represented as "RA" type for support and "CA" type for attack relations. - The relations between the "I" nodes and argument relation nodes are presented as edges.

Installation

Requirements for Installation

torch numpy transformers xaif_eval==0.0.9 amf-fast-inference==0.0.3 markdown2

Installation Setup

Using Docker Container

To set up the BERT Textual Entailment Service using Docker, follow these steps:

  1. Clone the Repository: sh git clone https://github.com/arg-tech/bert-te.git

  2. Navigate to the Project Root Directory: sh cd bert-te

  3. Make Required Changes:

  4. Build and Run the Docker Container: sh docker-compose up

From Source Without Docker

If you prefer to install without Docker:

  1. Install Dependencies:

  2. Configure and Run:

Usage

Using Programming Interface

Example Python Code Snippet

```python import requests import json

url = 'http://your-server-url/bert-te' inputfilepath = 'example_xAIF.json'

with open(inputfilepath, 'r', encoding='utf-8') as file: files = {'file': (inputfilepath, file, 'application/json')}

response = requests.post(url, files=files)

if response.statuscode == 200: outputfilepath = 'outputxAIF.json' with open(outputfilepath, 'w', encoding='utf-8') as outputfile: json.dump(response.json(), outputfile, ensureascii=False, indent=4) print(f'Response saved to {outputfilepath}') else: print(f'Failed to make a POST request. Status code: {response.statuscode}') print(response.text)

```

Using cURL

bash curl -X POST \ -F "file=@example_xAIF.json" \ http://your-server-url/bert-te

Using Web Interface

The service can also be used to create a pipeline on our n8n interface. Simply create an HTTP node, configure the node including the URL of the service and the parameter name of the file (file).

Image Description