Skip to content

Commit

Permalink
add fact-check
Browse files Browse the repository at this point in the history
  • Loading branch information
ziodave committed Jan 17, 2024
1 parent cd93f22 commit b7b36c5
Show file tree
Hide file tree
Showing 58 changed files with 776 additions and 93 deletions.
1 change: 1 addition & 0 deletions .bin/rebuild-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ npm run docusaurus clean-api-docs analysis && npm run docusaurus gen-api-docs an
npm run docusaurus clean-api-docs classification && npm run docusaurus gen-api-docs classification
npm run docusaurus clean-api-docs content-generation && npm run docusaurus gen-api-docs content-generation
npm run docusaurus clean-api-docs events && npm run docusaurus gen-api-docs events
npm run docusaurus clean-api-docs fact-check && npm run docusaurus gen-api-docs fact-check
npm run docusaurus clean-api-docs graphql && npm run docusaurus gen-api-docs graphql
npm run docusaurus clean-api-docs inspector && npm run docusaurus gen-api-docs inspector
npm run docusaurus clean-api-docs long-tail && npm run docusaurus gen-api-docs long-tail
Expand Down
43 changes: 43 additions & 0 deletions api/fact-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
openapi: 3.0.0
info:
title: WordLift Fact-Checking API
version: 1.0.0
description: API for semi-automated fact-checking. Returns schema.org/ClaimReview markup. This markup is structured data that contains information about the fact check -- for example, what was the claim being assessed, who made the claim, what was the verdict.
servers:
- url: https://api.wordlift.io
paths:
/fact-check/score:
post:
summary: Submit a fact-checking request
operationId: submitFactCheck
tags:
- Fact Check
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
query:
type: string
example: "Aristotele said 'It is the mark of an educated mind to be able to entertain a thought without accepting it.'"
responses:
'200':
description: Fact-checking result
content:
application/json:
schema:
type: object
properties:
response:
type: string
example: "{\n \"@context\": \"http://schema.org\",\n \"@type\": \"ClaimReview\",\n \"claimReviewed\": \"Aristotle quote 'It is the mark of an educated mind to be able to entertain a thought without accepting it.'\",\n \"author\": { \"@type\": \"Organization\", \"name\": \"WordLift\" },\n \"datePublished\": \"2024-01-17\",\n \"reviewRating\": {\n \"@type\": \"Rating\",\n \"ratingValue\": \"5\",\n \"alternateName\": \"True\",\n \"bestRating\": \"5\",\n \"worstRating\": \"1\"\n },\n \"url\": \"https://fact-check.wordlift.io/review/aristotle-quote\",\n \"reviewBody\": \"The quote 'It is the mark of an educated mind to be able to entertain a thought without accepting it.' is correctly attributable to Aristotle. It has been found in multiple credible sources, including publications of academic texts, reputable quote repositories, and philosophical discussions.\",\n \"itemReviewed\": {\n \"@type\": \"CreativeWork\",\n \"url\": [\"https://www.azquotes.com/quote/10261\", \"https://philosiblog.com/2012/03/07/it-is-the-mark-of-an-educated-mind-to-be-able-to-entertain-a-thought-without-accepting-it/\", \"https://www.brainyquote.com/quotes/aristotle_100584\", \"https://www.goodreads.com/quotes/1629-it-is-the-mark-of-an-educated-mind-to-be\", \"https://www.socratic-method.com/philosophy-quote-meanings/aristotle-it-is-the-mark-of-an-educated-mind-to-be-able-to-entertain-a-thought-without-accepting-it\"]\n }\n}"
security:
- ApiKeyAuth: []
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Create new

Created

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"account_id"} required={true} schemaName={"int64"} qualifierMessage={undefined} schema={{"type":"integer","format":"int64","description":"The Account id bound to this Content Generation."}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The create date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"deleted"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","default":false,"description":"True if the project has been deleted."}}></SchemaItem><SchemaItem collapsible={false} name={"deleted_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The delete date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"graphql_query"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The GraphQL query which will be used to import entity data from the Knowledge Graph."}}></SchemaItem><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"type":"integer","format":"int64","description":"The unique id.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"max_tokens"} required={false} schemaName={"int32"} qualifierMessage={"**Possible values:** `<= 2000`"} schema={{"type":"integer","format":"int32","default":64,"description":"The maximum number of tokens.","maximum":2000,"minimum":0}}></SchemaItem><SchemaItem collapsible={false} name={"model"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** `<= 250 characters`"} schema={{"type":"string","default":"ada","description":"The model name.","maxLength":250,"minLength":0}}></SchemaItem><SchemaItem collapsible={false} name={"modified_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The last modified date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** `<= 250 characters`"} schema={{"type":"string","description":"The name.","maxLength":250,"minLength":0}}></SchemaItem><SchemaItem collapsible={false} name={"penalty"} required={false} schemaName={"double"} qualifierMessage={"**Possible values:** `>= 0.5` and `<= 1.9`"} schema={{"type":"number","format":"double","default":0.5,"description":"The penalty score.","exclusiveMaximum":false,"exclusiveMinimum":false,"maximum":1.9,"minimum":0.5}}></SchemaItem><SchemaItem collapsible={false} name={"prompt_template"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The prompt template."}}></SchemaItem><SchemaItem collapsible={false} name={"stop"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","default":"###","description":"The stop sequence."}}></SchemaItem><SchemaItem collapsible={false} name={"temperature"} required={false} schemaName={"double"} qualifierMessage={"**Possible values:** `>= 0.4` and `<= 0.8`"} schema={{"type":"number","format":"double","default":0.4,"description":"The temperature score.","exclusiveMaximum":false,"exclusiveMinimum":false,"maximum":0.8,"minimum":0.4}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"account_id\": 0,\n \"created_at\": \"2023-12-24T08:00:14.937Z\",\n \"deleted\": false,\n \"deleted_at\": \"2023-12-24T08:00:14.937Z\",\n \"graphql_query\": \"string\",\n \"id\": 0,\n \"max_tokens\": 64,\n \"model\": \"ada\",\n \"modified_at\": \"2023-12-24T08:00:14.937Z\",\n \"name\": \"string\",\n \"penalty\": 0.5,\n \"prompt_template\": \"string\",\n \"stop\": \"###\",\n \"temperature\": 0.4\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>
</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"account_id"} required={true} schemaName={"int64"} qualifierMessage={undefined} schema={{"type":"integer","format":"int64","description":"The Account id bound to this Content Generation."}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The create date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"deleted"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"type":"boolean","default":false,"description":"True if the project has been deleted."}}></SchemaItem><SchemaItem collapsible={false} name={"deleted_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The delete date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"graphql_query"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The GraphQL query which will be used to import entity data from the Knowledge Graph."}}></SchemaItem><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"type":"integer","format":"int64","description":"The unique id.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"max_tokens"} required={false} schemaName={"int32"} qualifierMessage={"**Possible values:** `<= 2000`"} schema={{"type":"integer","format":"int32","default":64,"description":"The maximum number of tokens.","maximum":2000,"minimum":0}}></SchemaItem><SchemaItem collapsible={false} name={"model"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** `<= 250 characters`"} schema={{"type":"string","default":"ada","description":"The model name.","maxLength":250,"minLength":0}}></SchemaItem><SchemaItem collapsible={false} name={"modified_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"type":"string","format":"date-time","description":"The last modified date-time.","readOnly":true}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** `<= 250 characters`"} schema={{"type":"string","description":"The name.","maxLength":250,"minLength":0}}></SchemaItem><SchemaItem collapsible={false} name={"penalty"} required={false} schemaName={"double"} qualifierMessage={"**Possible values:** `>= 0.5` and `<= 1.9`"} schema={{"type":"number","format":"double","default":0.5,"description":"The penalty score.","exclusiveMaximum":false,"exclusiveMinimum":false,"maximum":1.9,"minimum":0.5}}></SchemaItem><SchemaItem collapsible={false} name={"prompt_template"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","description":"The prompt template."}}></SchemaItem><SchemaItem collapsible={false} name={"stop"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","default":"###","description":"The stop sequence."}}></SchemaItem><SchemaItem collapsible={false} name={"temperature"} required={false} schemaName={"double"} qualifierMessage={"**Possible values:** `>= 0.4` and `<= 0.8`"} schema={{"type":"number","format":"double","default":0.4,"description":"The temperature score.","exclusiveMaximum":false,"exclusiveMinimum":false,"maximum":0.8,"minimum":0.4}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"account_id\": 0,\n \"created_at\": \"2024-01-17T14:56:48.091Z\",\n \"deleted\": false,\n \"deleted_at\": \"2024-01-17T14:56:48.091Z\",\n \"graphql_query\": \"string\",\n \"id\": 0,\n \"max_tokens\": 64,\n \"model\": \"ada\",\n \"modified_at\": \"2024-01-17T14:56:48.091Z\",\n \"name\": \"string\",\n \"penalty\": 0.5,\n \"prompt_template\": \"string\",\n \"stop\": \"###\",\n \"temperature\": 0.4\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>

Authentication Failure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The set of errors found for record.

The set of errors found for record.

</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"levelEnum"} required={false} schemaName={"LevelEnum"} qualifierMessage={"**Possible values:** [`RECOMMENDED`, `REQUIRED`]"} schema={{"type":"string","description":"The rule level.","enum":["RECOMMENDED","REQUIRED"],"title":"LevelEnum"}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"result"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`PASS`, `FAIL`, `SKIP`, `FIXED`]"} schema={{"type":"string","enum":["PASS","FAIL","SKIP","FIXED"]}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"completion\": \"string\",\n \"content_generation_id\": 0,\n \"data\": {},\n \"errors\": [\n {\n \"levelEnum\": \"RECOMMENDED\",\n \"name\": \"string\",\n \"result\": \"PASS\"\n }\n ],\n \"has_upvote\": true,\n \"id\": 0,\n \"is_accepted\": true,\n \"modified_at\": \"2023-12-24T08:00:14.940Z\",\n \"prompt\": \"string\",\n \"warnings\": [\n {\n \"levelEnum\": \"RECOMMENDED\",\n \"name\": \"string\",\n \"result\": \"PASS\"\n }\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>
</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"levelEnum"} required={false} schemaName={"LevelEnum"} qualifierMessage={"**Possible values:** [`RECOMMENDED`, `REQUIRED`]"} schema={{"type":"string","description":"The rule level.","enum":["RECOMMENDED","REQUIRED"],"title":"LevelEnum"}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"result"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`PASS`, `FAIL`, `SKIP`, `FIXED`]"} schema={{"type":"string","enum":["PASS","FAIL","SKIP","FIXED"]}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"completion\": \"string\",\n \"content_generation_id\": 0,\n \"data\": {},\n \"errors\": [\n {\n \"levelEnum\": \"RECOMMENDED\",\n \"name\": \"string\",\n \"result\": \"PASS\"\n }\n ],\n \"has_upvote\": true,\n \"id\": 0,\n \"is_accepted\": true,\n \"modified_at\": \"2024-01-17T14:56:48.094Z\",\n \"prompt\": \"string\",\n \"warnings\": [\n {\n \"levelEnum\": \"RECOMMENDED\",\n \"name\": \"string\",\n \"result\": \"PASS\"\n }\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"401"} value={"401"}><div>

Authentication Failure

Expand Down
Loading

0 comments on commit b7b36c5

Please sign in to comment.