This service, part of the Argument Mining Framework (AMF), classifies illocutionary forces in locutions as either Agreeing, Arguing, Asserting, Assertive Questioning, Challenging, Default Illocuting, Disagreeing, Pure Questioning, Restating, Rhetorical Questioning. It leverages a pre-trained LLM fine-tuned on the QT30, US2016, MM123, and MM2012 dataset. It can be integrated into the argument mining pipeline alongside other AMF components for further analysis and processing.
This application leverages a pruned and quantized RoBERTa-large model, fine-tuned on the AIFdb datasets, to perform communicative intent recognition in text-classification task settings. By pruning and quantizing the model, we achieve faster inference times without significantly compromising accuracy. The system maps illocutionary forces to their respective locutions in discourse. This approach ensures the model remains lightweight and suitable for real-time applications within AMF.
Details
amfws-intentifier.arg.tech/amf_nts
GET
, POST
GET Method
POST Method
file
parameter) in the xAIF format.JSON File: The input must be in xAIF format. For details on the xAIF JSON format, refer to xAIF format details. xAIF json can be viewed as a dictionary containing list of nodes, edges, locutions, among others.
Argument units and their relations are represented as nodes.
The relations between the nodes (argument units and relations) are presented as edges. In the following example, the xAIF involves L nodes, and YA nodes (relation nodes connecting the L nodes with the YA nodes). The nodes indicating the illocutionary forces (YA), has a default value of "Default Illocuting".
Example:
{
"AIF": {
"descriptorfulfillments": null,
"edges": [
{
"edgeID": 0,
"fromID": 0,
"toID": 4
},
{
"edgeID": 1,
"fromID": 4,
"toID": 3
},
{
"edgeID": 2,
"fromID": 1,
"toID": 6
},
{
"edgeID": 3,
"fromID": 6,
"toID": 5
},
{
"edgeID": 4,
"fromID": 2,
"toID": 8
},
{
"edgeID": 5,
"fromID": 8,
"toID": 7
}
],
"locutions": [
{
"nodeID": 0,
"personID": 0
},
{
"nodeID": 1,
"personID": 1
},
{
"nodeID": 2,
"personID": 2
}
],
"nodes": [
{
"nodeID": 0,
"text": "disagreements between party members are entirely to be expected.",
"type": "L"
},
{
"nodeID": 1,
"text": "the SNP has disagreements.",
"type": "L"
},
{
"nodeID": 2,
"text": "it's not uncommon for there to be disagreements between party members.",
"type": "L"
},
{
"nodeID": 3,
"text": "disagreements between party members are entirely to be expected.",
"type": "I"
},
{
"nodeID": 4,
"text": "Default Illocuting",
"type": "YA"
},
{
"nodeID": 5,
"text": "the SNP has disagreements.",
"type": "I"
},
{
"nodeID": 6,
"text": "Default Illocuting",
"type": "YA"
},
{
"nodeID": 7,
"text": "it's not uncommon for there to be disagreements between party members.",
"type": "I"
},
{
"nodeID": 8,
"text": "Default Illocuting",
"type": "YA"
}
],
"participants": [
{
"firstname": "Speaker",
"participantID": 0,
"surname": "1"
},
{
"firstname": "Speaker",
"participantID": 1,
"surname": "2"
}
],
"schemefulfillments": null
},
"dialog": true,
"ova": [],
"text": {
"txt": " Speaker 1 <span class=\"highlighted\" id=\"0\">disagreements between party members are entirely to be expected.</span>.<br><br> Speaker 2 <span class=\"highlighted\" id=\"1\">the SNP has disagreements.</span>.<br><br> Speaker 1 <span class=\"highlighted\" id=\"2\">it's not uncommon for there to be disagreements between party members. </span>.<br><br>"
}
}
The YA text values are updated with the values from the model's predictions.
{
"AIF": {
"descriptorfulfillments": null,
"edges": [
{
"edgeID": 0,
"fromID": 0,
"toID": 4
},
{
"edgeID": 1,
"fromID": 4,
"toID": 3
},
{
"edgeID": 2,
"fromID": 1,
"toID": 6
},
{
"edgeID": 3,
"fromID": 6,
"toID": 5
},
{
"edgeID": 4,
"fromID": 2,
"toID": 8
},
{
"edgeID": 5,
"fromID": 8,
"toID": 7
},
{
"edgeID": 6,
"fromID": 3,
"toID": 9
},
{
"edgeID": 7,
"fromID": 9,
"toID": 7
}
],
"locutions": [
{
"nodeID": 0,
"personID": 0
},
{
"nodeID": 1,
"personID": 1
},
{
"nodeID": 2,
"personID": 2
}
],
"nodes": [
{
"nodeID": 0,
"text": "disagreements between party members are entirely to be expected.",
"type": "L"
},
{
"nodeID": 1,
"text": "the SNP has disagreements.",
"type": "L"
},
{
"nodeID": 2,
"text": "it's not uncommon for there to be disagreements between party members.",
"type": "L"
},
{
"nodeID": 3,
"text": "disagreements between party members are entirely to be expected.",
"type": "I"
},
{
"nodeID": 4,
"text": "Asserting",
"type": "YA"
},
{
"nodeID": 5,
"text": "the SNP has disagreements.",
"type": "I"
},
{
"nodeID": 6,
"text": "Arguing",
"type": "YA"
},
{
"nodeID": 7,
"text": "it's not uncommon for there to be disagreements between party members.",
"type": "I"
},
{
"nodeID": 8,
"text": "Disagreeing",
"type": "YA"
},
{
"nodeID": 9,
"text": "Default Inference",
"type": "RA"
}
],
"participants": [
{
"firstname": "Speaker",
"participantID": 0,
"surname": "1"
},
{
"firstname": "Speaker",
"participantID": 1,
"surname": "2"
}
],
"schemefulfillments": null
},
"dialog": true,
"ova": [],
"text": {
"txt": " Speaker 1 <span class=\"highlighted\" id=\"0\">disagreements between party members are entirely to be expected.</span>.<br><br> Speaker 2 <span class=\"highlighted\" id=\"1\">the SNP has disagreements.</span>.<br><br> Speaker 1 <span class=\"highlighted\" id=\"2\">it's not uncommon for there to be disagreements between party members. </span>.<br><br>"
}
}
Clone the Repository:
git clone https://github.com/arg-tech/amf_intent_recognition.git
Navigate to the Project Root Directory:
Make Required Changes:
Dockerfile
, and docker-compose.yml
files to specify the container name, port number, and other settings as needed.Build and Run the Docker Container:
docker-compose up --build
import requests
import json
url = 'http://your-server-url/amf_nts'
input_file_path = 'example_xAIF.json'
with open(input_file_path, 'r', encoding='utf-8') as file:
files = {'file': (input_file_path, file, 'application/json')}
response = requests.post(url, files=files)
if response.status_code == 200:
output_file_path = 'output_xAIF.json'
with open(output_file_path, 'w', encoding='utf-8') as output_file:
json.dump(response.json(), output_file, ensure_ascii=False, indent=4)
print(f'Response saved to {output_file_path}')
else:
print(f'Failed to make a POST request. Status code: {response.status_code}')
print(response.text)
curl -X POST \
-F "file=@example_xAIF.json" \
http://your-server-url/amf_nts
The service can also be used to create a pipeline on our n8n interface. The service can also be used to create a pipeline on our n8n interface.
file
)