File size: 533 Bytes
8868222
5262393
 
03eec87
b2a5e86
5262393
 
 
 
 
 
 
 
 
 
 
 
 
8868222
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import APIRouter
import logging

from commafixer.src.baseline import BaselineCommaFixer
from commafixer.routers.common import fix_commas_request_handler

logger = logging.Logger(__name__)
logging.basicConfig(level=logging.INFO)

router = APIRouter()

logger.info('Loading the baseline model...')
router.model = BaselineCommaFixer()


@router.post('/fix-commas/')
async def fix_commas_with_baseline(data: dict):
    json_field_name = 's'
    return fix_commas_request_handler(json_field_name, data, logger, router.model)