Skip to content

SMT API

Nechaev Yaroslav edited this page Jun 28, 2017 · 3 revisions

Social Media Toolkit

Social Media Toolkit provides some additional functionality on top of the SocialLink. Most of the functionality is exposed via an API for which the smt-ui component provides the UI.

Installation

Checkout and run mvn package. Note that since we haven't yet released any version of align component to Maven Central it is required that you build the align component with mvn install command before building the Social Media Toolkit.

eu.fbk.ict.fm.smt.Application acts as a startup script for the API. Please refer to script's help for the details on how to run it.

SMT API Documentation

Alignments

Correspond to the eu.fbk.ict.fm.smt.api.AlignmentsController class.

Method GET params
alignments/by_twitter_id id – Twitter ID
alignments/by_resource_uri uri – KB URI

Queries alignments by Twitter user ID or by DBpedia resource URI

Result example

http://api.smt.futuro.media/alignments/by_resource_uri?uri=http://wikidata.dbpedia.org/resource/Q76

{
  "code": 0,
  "message": "ok",
  "data": {
    "request": "http://wikidata.dbpedia.org/resource/Q76",
    "is_dead": false,
    "candidates": [
      {
        "uid": 813286,
        "score": 0.7990068
      },
      {
        "uid": 14099695,
        "score": 0.59378785
      },
      {
        "uid": 25830688,
        "score": 0.0
      },
      {
        "uid": 29170793,
        "score": 0.07035377
      },
      {
        "uid": 141405856,
        "score": 0.017899266
      },
      {
        "uid": 181743520,
        "score": 0.59829485
      }
    ]
  }
}

Annotation

Custom annotation pipeline that does live Twitter queries and aligns using a simple alignment pipelines. Correspond to the eu.fbk.ict.fm.smt.api.AnnotationController class.

Method GET params Desc
annotate/ner text – Target text Runs NER on the target text
annotate/twitter token – selected token, ner — token class, text — text to be used as a context Aligns token live to Twitter
annotate/twitter/simple token – selected token, ner — token class, text — text to be used as a context Aligns token live to Twitter using minimal alignment pipeline
is_similar resource – DBpedia URI, uid — Twitter id Returns similarity score between DBpedia URI and Twitter id
/ text – Target text Aligns all entities in the target text to Twitter

Limits

Correspond to the eu.fbk.ict.fm.smt.api.LimitsController class.

Method GET params Desc
/ — Returns current system limits based on the remaining Twitter quota

Clone this wiki locally