Factiverse AI Fact-check

Factiverse AI Fact-check · GPT アクション

Fast-Brenda

BRENDA is a RESTful Inference API which handles authenticated client and server-side requests. In order to use the BRENDA API you require to register an account with the Factiverse team.

  • POST /v1/stance_detectionFact check a given single claim.

    Stance detection endpoint (POST). Args: lang: Output language. Will attempt to detect if empty string. evidence: List of evidence dictionaries. If no evidence is available, get_stance_input() will search and gather by itself. Returns: StanceResponse dataclass.

  • POST /v1/claim_detectionDetect checkworthy claims in the given text.

    Claim detection endpoint (POST). Args: lang: Output language. Will attempt to detect if empty string. Supported languages: text: Text to run claim detection on. Returns: ClaimResponse dataclass.

元の API スキーマ
{
  "openapi": "3.0.2",
  "info": {
    "title": "Fast-Brenda",
    "description": "BRENDA is a RESTful Inference API which handles authenticated client and server-side requests. In order to use the BRENDA API you require to register an account with the Factiverse team.",
    "termsOfService": "https://www.factiverse.ai/terms/",
    "contact": {
      "name": "API Support",
      "url": "https://www.factiverse.ai/"
    },
    "license": {
      "name": "Factiverse Copyright",
      "url": "https://www.factiverse.ai/copyright"
    },
    "version": "1.0.7"
  },
  "servers": [
    {
      "url": "https://aiplugin.factiverse.ai"
    }
  ],
  "paths": {
    "/v1/stance_detection": {
      "post": {
        "tags": [
          "Stance Detection"
        ],
        "summary": "Fact check a given single claim.",
        "description": "Stance detection endpoint (POST).\n\nArgs:\n    lang: Output language. Will attempt to detect if empty string.\n    evidence: List of evidence dictionaries.\n      If no evidence is available, get_stance_input() will search and gather\n      by itself.\nReturns:\n    StanceResponse dataclass.",
        "operationId": "stance_detection_v1_stance_detection_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__server__pipeline__requests__stance__Post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StanceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "Auth0ImplicitBearer": []
          }
        ],
        "x-openai-isConsequential": false
      }
    },
    "/v1/claim_detection": {
      "post": {
        "tags": [
          "Claim Detection"
        ],
        "summary": "Detect checkworthy claims in the given text.",
        "description": "Claim detection endpoint (POST).\n\nArgs:\n    lang: Output language. Will attempt to detect if empty string.\n        Supported languages:\n    text: Text to run claim detection on.\n\nReturns:\n    ClaimResponse dataclass.",
        "operationId": "claim_detection_v1_claim_detection_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/src__server__pipeline__requests__claim_detection__Post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "Auth0ImplicitBearer": []
          }
        ],
        "x-openai-isConsequential": false
      }
    }
  },
  "components": {
    "schemas": {
      "ClaimResponse": {
        "title": "ClaimResponse",
        "required": [
          "detectedClaims"
        ],
        "type": "object",
        "properties": {
          "_id": {
            "title": " Id",
            "type": "string"
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "init": false
          },
          "detectedClaims": {
            "title": "Detectedclaims",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DetectedClaim"
            }
          }
        },
        "description": "API response for claim detection endpoint."
      },
      "DetectedClaim": {
        "title": "DetectedClaim",
        "required": [
          "claim",
          "score"
        ],
        "type": "object",
        "properties": {
          "_id": {
            "title": " Id",
            "type": "string"
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "init": false
          },
          "claim": {
            "title": "Claim",
            "type": "string"
          },
          "score": {
            "title": "Score",
            "type": "number"
          }
        },
        "description": "A detected claim."
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "SearchResult": {
        "title": "SearchResult",
        "type": "object",
        "properties": {
          "_id": {
            "title": " Id",
            "type": "string",
            "description": "Id in the logging database."
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "description": "Collection name."
          },
          "doc": {
            "title": "Doc",
            "type": "string",
            "description": "Evidence text, e.g. document or snippet."
          },
          "title": {
            "title": "Title",
            "type": "string",
            "description": "E.g. article title of evidence."
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Url of evidence."
          },
          "domain": {
            "title": "Domain",
            "type": "string",
            "description": "Domain of evidence in format {name}.{extension}, E.g. cnn.com."
          },
          "domainName": {
            "title": "Domainname",
            "type": "string",
            "description": "Domain without extension. E.g. cnn, bbc, theguardian."
          },
          "snippet": {
            "title": "Snippet",
            "type": "string",
            "description": "Subset of the document relevant to the claim."
          },
          "publishDate": {
            "title": "Publishdate",
            "type": "string",
            "description": "(%Y-%m-%d %H:%M:%S)"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keywords in evidence where claim was issued.",
            "hash": false
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Authors behind the evidence.",
            "hash": false
          },
          "searchEngine": {
            "title": "Searchengine",
            "type": "string",
            "description": "Search engine used to get the result."
          },
          "simScore": {
            "title": "Simscore",
            "type": "number",
            "description": "Similarity score to the query or claim.",
            "default": 0,
            "hash": false
          }
        },
        "description": "Search result output.",
        "example": {
          "id": "620e5d5ec6c28d7ba5207caf",
          "collection": "search",
          "doc": "Physicists will find it shocking, but there are plenty of people around the world who genuinely believe the Earth isflat...",
          "title": "Fighting flat-Earth theory",
          "url": "https://physicsworld.com/a/fighting-flat-earth-theory/",
          "domain": "physicsworld.com",
          "domainName": "physicsworld",
          "snippet": "The flat-earth conspiracy has been debunkedthousands of times.",
          "publishDate": "2020-07-14 00:00:00",
          "keywords": [
            "earth"
          ],
          "authors": [
            "Rachel Brazil"
          ],
          "searchEngine": "google"
        }
      },
      "StanceLang": {
        "title": "StanceLang",
        "enum": [
          "af",
          "am",
          "ar",
          "as",
          "az",
          "be",
          "bg",
          "bn",
          "br",
          "bs",
          "ca",
          "cs",
          "cy",
          "da",
          "de",
          "el",
          "en",
          "eo",
          "es",
          "et",
          "eu",
          "fa",
          "fi",
          "fr",
          "fy",
          "ga",
          "gd",
          "gl",
          "gu",
          "ha",
          "he",
          "hi",
          "hr",
          "hu",
          "hy",
          "id",
          "is",
          "it",
          "ja",
          "jv",
          "ka",
          "kk",
          "km",
          "kn",
          "ko",
          "ku",
          "ky",
          "la",
          "lo",
          "lt",
          "lv",
          "mg",
          "mk",
          "ml",
          "mn",
          "mr",
          "ms",
          "my",
          "ne",
          "nl",
          "no",
          "om",
          "or",
          "pa",
          "pl",
          "ps",
          "pt",
          "ro",
          "ru",
          "sa",
          "sd",
          "si",
          "sk",
          "sl",
          "so",
          "sq",
          "sr",
          "su",
          "sv",
          "sw",
          "ta",
          "te",
          "th",
          "tl",
          "tr",
          "ug",
          "uk",
          "ur",
          "uz",
          "vi",
          "xh",
          "yi",
          "zh",
          ""
        ],
        "type": "string",
        "description": "An enumeration."
      },
      "StanceOutput": {
        "title": "StanceOutput",
        "type": "object",
        "properties": {
          "_id": {
            "title": " Id",
            "type": "string",
            "description": "Id in the logging database."
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "description": "Collection name."
          },
          "doc": {
            "title": "Doc",
            "type": "string",
            "description": "Evidence text, e.g. document or snippet."
          },
          "title": {
            "title": "Title",
            "type": "string",
            "description": "E.g. article title of evidence."
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "Url of evidence."
          },
          "domain": {
            "title": "Domain",
            "type": "string",
            "description": "Domain of evidence in format {name}.{extension}, E.g. cnn.com."
          },
          "domainName": {
            "title": "Domainname",
            "type": "string",
            "description": "Domain without extension. E.g. cnn, bbc, theguardian."
          },
          "snippet": {
            "title": "Snippet",
            "type": "string",
            "description": "Subset of the document relevant to the claim."
          },
          "publishDate": {
            "title": "Publishdate",
            "type": "string",
            "description": "(%Y-%m-%d %H:%M:%S)"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keywords in evidence where claim was issued.",
            "hash": false
          },
          "authors": {
            "title": "Authors",
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Authors behind the evidence.",
            "hash": false
          },
          "searchEngine": {
            "title": "Searchengine",
            "type": "string",
            "description": "Search engine used to get the result."
          },
          "simScore": {
            "title": "Simscore",
            "type": "number",
            "description": "Similarity score to the query or claim.",
            "default": 0,
            "hash": false
          },
          "labelDescription": {
            "title": "Labeldescription",
            "type": "string"
          },
          "predictedLabel": {
            "title": "Predictedlabel",
            "type": "integer"
          },
          "softmaxScore": {
            "title": "Softmaxscore",
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "evidenceSnippet": {
            "title": "Evidencesnippet",
            "type": "string"
          }
        },
        "description": "Output of stance detection model.\n\nTODO: #503 Check if Search result should inherit from Loggable.",
        "example": {
          "id": "620e5d5ec6c28d7ba5207caf",
          "collection": "search",
          "doc": "Physicists will find it shocking, but there are plenty of people around the world who genuinely believe the Earth isflat...",
          "title": "Fighting flat-Earth theory",
          "url": "https://physicsworld.com/a/fighting-flat-earth-theory/",
          "domain": "physicsworld.com",
          "domainName": "physicsworld",
          "snippet": "The flat-earth conspiracy has been debunkedthousands of times.",
          "publishDate": "2020-07-14 00:00:00",
          "keywords": [
            "earth"
          ],
          "authors": [
            "Rachel Brazil"
          ],
          "searchEngine": "google"
        }
      },
      "StanceResponse": {
        "title": "StanceResponse",
        "required": [
          "evidence"
        ],
        "type": "object",
        "properties": {
          "_id": {
            "title": " Id",
            "type": "string"
          },
          "collection": {
            "title": "Collection",
            "type": "string",
            "init": false
          },
          "claim": {
            "title": "Claim",
            "type": "string"
          },
          "evidence": {
            "title": "Evidence",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StanceOutput"
            }
          },
          "finalScore": {
            "title": "Finalscore",
            "type": "number"
          },
          "finalPrediction": {
            "title": "Finalprediction",
            "type": "integer"
          }
        },
        "description": "API response for stance detection endpoint."
      },
      "ValidationError": {
        "title": "ValidationError",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "type": "object",
        "properties": {
          "loc": {
            "title": "Location",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        }
      },
      "src__server__pipeline__requests__claim_detection__Post": {
        "title": "Post",
        "required": [
          "text"
        ],
        "type": "object",
        "properties": {
          "logging": {
            "title": "Logging",
            "type": "boolean",
            "description": "Avoid logging results when testing in UI",
            "default": false
          },
          "lang": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StanceLang"
              }
            ],
            "description": "ISO-639-1 language code.",
            "default": ""
          },
          "text": {
            "title": "Text",
            "type": "string",
            "description": "Text content to run claim detection on."
          },
          "claimScoreThreshold": {
            "title": "Claimscorethreshold",
            "maximum": 1,
            "minimum": 0,
            "type": "number",
            "description": "Score threshold for claim filtering.",
            "default": 0.7
          }
        },
        "description": "Claim Detection POST request.\n\nArgs:\n    BaseModel (_type_): Base Model.",
        "example": {
          "lang": "",
          "logging": false,
          "text": "I think we've seen a deterioration of values. US has the highest number of COVID infections ever.",
          "claimScoreThreshold": 0.9
        }
      },
      "src__server__pipeline__requests__stance__Post": {
        "title": "Post",
        "required": [
          "claim"
        ],
        "type": "object",
        "properties": {
          "logging": {
            "title": "Logging",
            "type": "boolean",
            "description": "Avoid logging results when testing in UI",
            "default": false
          },
          "lang": {
            "allOf": [
              {
                "$ref": "#/components/schemas/StanceLang"
              }
            ],
            "description": "ISO-639-1 language code.",
            "default": ""
          },
          "claim": {
            "title": "Claim",
            "type": "string",
            "description": "Text content to run stance detection on."
          },
          "evidence": {
            "title": "Evidence",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            }
          }
        },
        "description": "Stance POST request.",
        "example": {
          "logging": false,
          "lang": "",
          "claim": "The earth is flat."
        }
      }
    },
    "securitySchemes": {
      "Auth0ImplicitBearer": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "scopes": {
              "post:bias_detection": "Access to Bias Detection POST.",
              "post:claim_detection": "Access to Claim Detection POST.",
              "post:claim_search": "Access to Claim Search.",
              "get:entity": "Access to Entity GET.",
              "post:entity": "Access to Entity POST.",
              "put:entity": "Access to Entity PUT.",
              "delete:entity": "Access to Entity DELETE.",
              "get:microfact": "Access to Microfact GET.",
              "post:feedback": "Access to Feedback POST.",
              "post:microfact": "Access to Microfact POST.",
              "post:stance_detection": "Access to Stance Detection POST.",
              "post:search": "Access to Search POST.",
              "post:fact_check": "Access to fact check POST.",
              "read:entity:snl": "Allows the user to READ SNL Entity Descriptions.",
              "read:entity:wikipedia": "Allows the user to READ WIKIPEDIA Entity Descriptions.",
              "read:entity:wikidata": "Allows the user to READ WIKIDATA Entity Descriptions.",
              "create:entity:factiverse": "Allows the user to CREATE Factiverse Entity Descriptions.",
              "update:entity:factiverse": "Allows the user to UPDATE Factiverse Entity Descriptions.",
              "read:entity:factiverse": "Allows the user to read Factiverse Entity Descriptions.",
              "delete:entity:factiverse": "Allows the user to delete Factiverse Entity Descriptions."
            },
            "authorizationUrl": "https://auth.factiverse.ai/authorize?audience=https%3A%2F%2Ffactiverse%2Fapi"
          }
        }
      }
    }
  }
}