RUPunct / RUPunct_small

huggingface.co
Total runs: 2.1K
24-hour runs: 0
7-day runs: 6
30-day runs: 984
Model's Last Updated: May 01 2024
token-classification

Introduction of RUPunct_small

Model Details of RUPunct_small

RUPunct_small - самая маленькая модель из семейства RUPunct. Идеально подходит для несложных текстов и там, где требуется высокая скорость работы на CPU.

Код инференса:

from transformers import pipeline
from transformers import AutoTokenizer

pt = "RUPunct/RUPunct_small"

tk = AutoTokenizer.from_pretrained(pt, strip_accents=False, add_prefix_space=True)
classifier = pipeline("ner", model=pt, tokenizer=tk, aggregation_strategy="first")


def process_token(token, label):
    if label == "LOWER_O":
        return token
    if label == "LOWER_PERIOD":
        return token + "."
    if label == "LOWER_COMMA":
        return token + ","
    if label == "LOWER_QUESTION":
        return token + "?"
    if label == "LOWER_TIRE":
        return token + "—"
    if label == "LOWER_DVOETOCHIE":
        return token + ":"
    if label == "LOWER_VOSKL":
        return token + "!"
    if label == "LOWER_PERIODCOMMA":
        return token + ";"
    if label == "LOWER_DEFIS":
        return token + "-"
    if label == "LOWER_MNOGOTOCHIE":
        return token + "..."
    if label == "LOWER_QUESTIONVOSKL":
        return token + "?!"
    if label == "UPPER_O":
        return token.capitalize()
    if label == "UPPER_PERIOD":
        return token.capitalize() + "."
    if label == "UPPER_COMMA":
        return token.capitalize() + ","
    if label == "UPPER_QUESTION":
        return token.capitalize() + "?"
    if label == "UPPER_TIRE":
        return token.capitalize() + " —"
    if label == "UPPER_DVOETOCHIE":
        return token.capitalize() + ":"
    if label == "UPPER_VOSKL":
        return token.capitalize() + "!"
    if label == "UPPER_PERIODCOMMA":
        return token.capitalize() + ";"
    if label == "UPPER_DEFIS":
        return token.capitalize() + "-"
    if label == "UPPER_MNOGOTOCHIE":
        return token.capitalize() + "..."
    if label == "UPPER_QUESTIONVOSKL":
        return token.capitalize() + "?!"
    if label == "UPPER_TOTAL_O":
        return token.upper()
    if label == "UPPER_TOTAL_PERIOD":
        return token.upper() + "."
    if label == "UPPER_TOTAL_COMMA":
        return token.upper() + ","
    if label == "UPPER_TOTAL_QUESTION":
        return token.upper() + "?"
    if label == "UPPER_TOTAL_TIRE":
        return token.upper() + " —"
    if label == "UPPER_TOTAL_DVOETOCHIE":
        return token.upper() + ":"
    if label == "UPPER_TOTAL_VOSKL":
        return token.upper() + "!"
    if label == "UPPER_TOTAL_PERIODCOMMA":
        return token.upper() + ";"
    if label == "UPPER_TOTAL_DEFIS":
        return token.upper() + "-"
    if label == "UPPER_TOTAL_MNOGOTOCHIE":
        return token.upper() + "..."
    if label == "UPPER_TOTAL_QUESTIONVOSKL":
        return token.upper() + "?!"

while 1:
    input_text = input(":> ")
    preds = classifier(input_text)
    output = ""
    for item in preds:
        output += " " + process_token(item['word'].strip(), item['entity_group'])
    print(">>>", output)

Runs of RUPunct RUPunct_small on huggingface.co

2.1K
Total runs
0
24-hour runs
6
3-day runs
6
7-day runs
984
30-day runs

More Information About RUPunct_small huggingface.co Model

More RUPunct_small license Visit here:

https://choosealicense.com/licenses/mit

RUPunct_small huggingface.co

RUPunct_small huggingface.co is an AI model on huggingface.co that provides RUPunct_small's model effect (), which can be used instantly with this RUPunct RUPunct_small model. huggingface.co supports a free trial of the RUPunct_small model, and also provides paid use of the RUPunct_small. Support call RUPunct_small model through api, including Node.js, Python, http.

RUPunct_small huggingface.co Url

https://huggingface.co/RUPunct/RUPunct_small

RUPunct RUPunct_small online free

RUPunct_small huggingface.co is an online trial and call api platform, which integrates RUPunct_small's modeling effects, including api services, and provides a free online trial of RUPunct_small, you can try RUPunct_small online for free by clicking the link below.

RUPunct RUPunct_small online free url in huggingface.co:

https://huggingface.co/RUPunct/RUPunct_small

RUPunct_small install

RUPunct_small is an open source model from GitHub that offers a free installation service, and any user can find RUPunct_small on GitHub to install. At the same time, huggingface.co provides the effect of RUPunct_small install, users can directly use RUPunct_small installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

RUPunct_small install url in huggingface.co:

https://huggingface.co/RUPunct/RUPunct_small

Url of RUPunct_small

RUPunct_small huggingface.co Url

Provider of RUPunct_small huggingface.co

RUPunct
ORGANIZATIONS

Other API from RUPunct

huggingface.co

Total runs: 49.5K
Run Growth: 11.2K
Growth Rate: 22.62%
Updated:May 01 2024