Views
No views yet
Volunteering
It's all about the warm, fuzzy feeling when you serve the community, without expectation of gain. Volunteering offers you the necessary experience and development skills to take forward with you, as you venture out to work with other people and apply what you learn, to achieve your career goals.
HOW IT WORKS
SEARCH
BOOK NOW
ENJOY THE SHOW
GET A FREE QUOTE
Planning your event ahead of time is the right move. Contact our experts and let us surprise you.LowSharapova has been in New Zealand since well before the New Year, preparing for her 2011 start and requested the opening day match to test her form. "My last tournament was over two months ago and it will be really good to get back playing again."
"My priority since I have been here has been to adjust to time and conditions. I have had a couple of practices a day and think that has been really important."
The three-time Grand Slam champion who once stood number one next plays Voracova after winning their only previous match in 2003.HighReasons to visit Thatta
Thatta is one of the most important cities of the province of Sindh, Pakistan. Historically it is the richest city. The sands of Thatta have seen many great men. It provided Alexander the Great and his troops a comfortable resting place before they moved further. It welcomed the Mughal Emperor Shah Jehan.Medium1import torch
2from torch import nn
3from transformers import AutoModel, AutoTokenizer, AutoConfig
4from huggingface_hub import PyTorchModelHubMixin
5
6
7class QualityModel(nn.Module, PyTorchModelHubMixin):
8 def __init__(self, config):
9 super(QualityModel, self).__init__()
10 self.model = AutoModel.from_pretrained(config["base_model"])
11 self.dropout = nn.Dropout(config["fc_dropout"])
12 self.fc = nn.Linear(self.model.config.hidden_size, len(config["id2label"]))
13
14 def forward(self, input_ids, attention_mask):
15 features = self.model(
16 input_ids=input_ids, attention_mask=attention_mask
17 ).last_hidden_state
18 dropped = self.dropout(features)
19 outputs = self.fc(dropped)
20 return torch.softmax(outputs[:, 0, :], dim=1)
21
22
23device = "cuda" if torch.cuda.is_available() else "cpu"
24
25# Setup configuration and model
26config = AutoConfig.from_pretrained("nvidia/quality-classifier-deberta")
27tokenizer = AutoTokenizer.from_pretrained("nvidia/quality-classifier-deberta")
28model = QualityModel.from_pretrained("nvidia/quality-classifier-deberta").to(device)
29model.eval()
30
31# Prepare and process inputs
32text_samples = [".?@fdsa Low quality text.", "This sentence is ok."]
33inputs = tokenizer(
34 text_samples, return_tensors="pt", padding="longest", truncation=True
35).to(device)
36outputs = model(inputs["input_ids"], inputs["attention_mask"])
37
38# Predict and display results
39predicted_classes = torch.argmax(outputs, dim=1)
40predicted_domains = [
41 config.id2label[class_idx.item()] for class_idx in predicted_classes.cpu().numpy()
42]
43print(predicted_domains)
44# ['Low', 'Medium']0.8252| Precision | Recall | F1-Score | |
|---|---|---|---|
| High | 0.5043 | 0.1776 | 0.2626 |
| Medium | 0.8325 | 0.9396 | 0.8825 |
| Low | 0.8510 | 0.7279 | 0.7842 |
| High | Medium | Low | |
|---|---|---|---|
| High | 117 | 541 | 1 |
| Medium | 115 | 4688 | 187 |
| Low | 0 | 402 | 1077 |