https://github.com/kuro-jojo/bert-transaction-categorizer-api
An api that take a transaction and, using a fine tuned bert model, try to find the suitable category for it.
https://github.com/kuro-jojo/bert-transaction-categorizer-api
Last synced: 2 months ago
JSON representation
An api that take a transaction and, using a fine tuned bert model, try to find the suitable category for it.
- Host: GitHub
- URL: https://github.com/kuro-jojo/bert-transaction-categorizer-api
- Owner: kuro-jojo
- License: apache-2.0
- Created: 2025-01-28T16:08:25.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-28T16:30:18.000Z (4 months ago)
- Last Synced: 2025-01-28T17:33:34.644Z (4 months ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Transaction Categorization API
This API categorizes financial transactions using a fine-tuned BERT model. It provides endpoints to categorize single or multiple transactions.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Endpoints](#endpoints)
- [Request Schema](#request-schema)
- [Response Schema](#response-schema)## Installation
1. Clone the repository:
```sh
git clone
cd
```2. Create and activate a virtual environment:
```sh
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```3. Install the dependencies:
```sh
pip install -r requirements.txt
```4. Run the application:
```sh
fastapi dev src/main.py
```## Usage
Once the application is running, you can access the API at `http://127.0.0.1:8000`.
## Endpoints
### Root Endpoint
- **GET** `/api/v1/`
- **Description**: Health check endpoint.
- **Response**: `{ "message": "Transaction Categorization API is running" }`### Categorize Single Transaction
- **POST** `/api/v1/categorize/`
- **Description**: Categorizes a single transaction.
- **Request Body**: [TransactionRequest](http://_vscodecontentref_/1)
- **Response**: `TransactionResponse`### Categorize Multiple Transactions
- **POST** `/api/v1/categorize/bulk/`
- **Description**: Categorizes multiple transactions.
- **Request Body**: List of [TransactionRequest](http://_vscodecontentref_/2)
- **Response**: List of `TransactionResponse`## Request Schema
### TransactionRequest
```json
{
"id": "string (optional)",
"description": "string",
"t_type": "string"
}
```## Response Schema
For single transaction categorization:
```json
{
"id": "string",
"label": "string"
}
```
For multiple transactions categorization:```json
[
{
"id": "string",
"categories": [
{
"label": "string",
"score": "string"
}
]
}
]
```