Model Card for Model ID

Training Accuracy Epoch: 88.21% Validation Accuracy Epoch: 93.26%

Usage

import torch
from transformers import AutoModel, AutoTokenizer, RobertaModel, RobertaPreTrainedModel

class RobertaClassClassifier(torch.nn.Module):
    def __init__(self):
        super(RobertaClassClassifier, self).__init__()
        self.pre_classifier = torch.nn.Linear(768, 768)
        self.dropout = torch.nn.Dropout(0.3)
        self.classifier = torch.nn.Linear(768, 2)

    def forward(self, hidden_state):
        pooler = hidden_state[:, 0]
        pooler = self.pre_classifier(pooler)
        pooler = torch.nn.ReLU()(pooler)
        pooler = self.dropout(pooler)
        output = self.classifier(pooler)
        return output

class MainModel(RobertaPreTrainedModel):
    def __init__(self, config):

        super().__init__(config)
        self.config = config
        self.roberta = RobertaModel(config)
        self.classifier = RobertaClassClassifier()
        self.init_weights()

    def forward(self, input_ids, attention_mask, token_type_ids):
        hidden_states = self.roberta(input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids)
        logits = self.classifier(hidden_states[0])

        return logits

model = MainModel.from_pretrained("arkiven4/phobert-sentiment-v2")
tokenizer = AutoTokenizer.from_pretrained("arkiven4/phobert-sentiment-v2")

text = str('mแป™t mแป› lแป—i : khรดng xem_lแบกi ฤ‘ฦฐแปฃc bร i test , khรดng hiแป‡n link ( vรญ_dแปฅ nhฦฐ lร  youtube khi chia_sแบป ) khรดng copy ฤ‘ฦฐแปฃc tแปซ khรดng biแบฟt ฤ‘แปƒ dแป‹ch . lร m_ฦกn cho vแป bแบฃn web ฤ‘i')
text = " ".join(text.split())

inputs = tokenizer.encode_plus(
    text,
    None,
    add_special_tokens=True,
    max_length=256,
    pad_to_max_length=True,
    return_token_type_ids=True,
    return_tensors="pt"
)

with torch.no_grad():
  predicts = model(inputs['input_ids'], inputs['attention_mask'], inputs['token_type_ids'])

torch.argmax(predicts, dim=1)
# tensor([1])

Model Details

Model Description

This is the model card of a ๐Ÿค— transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • Developed by: [More Information Needed]
  • Funded by [optional]: [More Information Needed]
  • Shared by [optional]: [More Information Needed]
  • Model type: [More Information Needed]
  • Language(s) (NLP): [More Information Needed]
  • License: [More Information Needed]
  • Finetuned from model [optional]: [More Information Needed]

Model Sources [optional]

  • Repository: [More Information Needed]
  • Paper [optional]: [More Information Needed]
  • Demo [optional]: [More Information Needed]

Uses

Direct Use

[More Information Needed]

Downstream Use [optional]

[More Information Needed]

Out-of-Scope Use

[More Information Needed]

Bias, Risks, and Limitations

[More Information Needed]

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

How to Get Started with the Model

Use the code below to get started with the model.

[More Information Needed]

Training Details

Training Data

[More Information Needed]

Training Procedure

Preprocessing [optional]

[More Information Needed]

Training Hyperparameters

  • Training regime: [More Information Needed]

Speeds, Sizes, Times [optional]

[More Information Needed]

Evaluation

Testing Data, Factors & Metrics

Testing Data

[More Information Needed]

Factors

[More Information Needed]

Metrics

[More Information Needed]

Results

[More Information Needed]

Summary

Model Examination [optional]

[More Information Needed]

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: [More Information Needed]
  • Hours used: [More Information Needed]
  • Cloud Provider: [More Information Needed]
  • Compute Region: [More Information Needed]
  • Carbon Emitted: [More Information Needed]

Technical Specifications [optional]

Model Architecture and Objective

[More Information Needed]

Compute Infrastructure

[More Information Needed]

Hardware

[More Information Needed]

Software

[More Information Needed]

Citation [optional]

BibTeX:

[More Information Needed]

APA:

[More Information Needed]

Glossary [optional]

[More Information Needed]

More Information [optional]

[More Information Needed]

Model Card Authors [optional]

[More Information Needed]

Model Card Contact

[More Information Needed]

Downloads last month
8
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for arkiven4/phobert-sentiment-v2