import numpy as np import pandas as pd import seaborn as sns from typing import Optional, List, Tuple, Any from collections import OrderedDict import os import ast import re import string from sklearn.preprocessing import MultiLabelBinarizer, LabelEncoder import torch from torch.utils.data import Dataset, DataLoader from sklearn.model_selection import train_test_split import datasets import transformers from transformers import AutoTokenizer, AutoModel, AutoModelForSequenceClassification, Trainer, TrainingArguments, logging, RobertaForTokenClassification, RobertaConfig, AutoConfig from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torchcrf import CRF from accelerate import Accelerator import torch.nn as nn import torch.nn.functional as F import underthesea from utils import * from all_datasets import * from model import *