File size: 586 Bytes
4398510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import asyncio
from typing import List
from context import use_WSG
from utils.ckip.pos import PosTagging
from utils.text import add_multiple_textsubscripts


def handle_create_pos(nlp_model: str, sentence_list: List[str]):
    """The handle_create_pos function handles the request that deals with pos-tagging.
    Args:
        sentence_list (list): a list of sentences
    Returns:
        a list of strings
    """

    ws_result = use_WSG()[0]
    segmented_result = PosTagging(nlp_model, ws_result).tag()
    return asyncio.run(add_multiple_textsubscripts("pos", segmented_result))