Skip to content

fernandabaiao/oasis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 OASIS: Ontology-Assisted System for Improving Specialized QA

OASIS provides an API and interface for Entity Linking and Light Semantics, designed to support ontology-driven reasoning in specialized Question-Answering systems.

This repository contains the FastAPI backend, exposing endpoints that process sessions, entities, and lightweight semantic relations.


📦 1. Installation

Clone the repository

git clone https://github.com/<user>/ontoqa-system.git
cd ontoqa-system

Create a virtual environment

python -m venv .venv
source .venv/bin/activate    # Linux/Mac
.venv\Scripts\activate       # Windows

Install dependencies

pip install -r requirements.txt

▶️ 2. Running the API

From the project root, execute:

uvicorn app.main:app --reload

Make sure you are in the project root directory, where the app/ folder is located.

API Base URL

http://127.0.0.1:8000

Interactive Documentation

  • Swagger UI:

    http://127.0.0.1:8000/docs
    
  • ReDoc:

    http://127.0.0.1:8000/redoc
    

🧭 3. API Endpoints


## 📌 Entity Linking

POST /v1/entity-linking

Request Body Example

{
  "session": 142041
}

cURL

curl -X POST "http://127.0.0.1:8000/v1/entity-linking" \
     -H "Content-Type: application/json" \
     -d "{\"session\": 142041}"

## 📌 Light Semantics

POST /v1/light-semantics

Request Body Example

{
  "entities": ["17", "26", "30"]
}

cURL

curl -X POST "http://127.0.0.1:8000/v1/light-semantics" \
     -H "Content-Type: application/json" \
     -d "{\"entities\": [\"17\", \"26\", \"30\"]}"

🐍 4. Using the API in Python

Below are examples using the requests library.

📌 Entity Linking (Python)

import requests

url = "http://127.0.0.1:8000/v1/entity-linking"
payload = {"session": 142041}

response = requests.post(url, json=payload)
print(response.json())

📌 Light Semantics (Python)

import requests

url = "http://127.0.0.1:8000/v1/light-semantics"
payload = {"entities": ["17", "26", "30"]}

response = requests.post(url, json=payload)
print(response.json())

About

A graphical interface for Entity Linking e Light Semantic Enrichment modules of an R&D project at PUC-Rio, in collabortion with StoneLab, which built a chatBot semantically enriched with a well-founded ontology in the "PIX" financial domain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%