Update README.md
Browse files
README.md
CHANGED
|
@@ -41,7 +41,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
| 41 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 42 |
|
| 43 |
# Define the amino acid sequence
|
| 44 |
-
sequence = "
|
| 45 |
|
| 46 |
# Tokenize the sequence
|
| 47 |
inputs = tokenizer(sequence, return_tensors="pt")
|
|
@@ -52,9 +52,11 @@ with torch.no_grad():
|
|
| 52 |
logits = outputs.logits
|
| 53 |
predicted_class_id = logits.argmax().item()
|
| 54 |
|
| 55 |
-
#
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
print(f"The predicted class for the sequence is: {predicted_label}")
|
| 60 |
|
|
|
|
| 41 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 42 |
|
| 43 |
# Define the amino acid sequence
|
| 44 |
+
sequence = "MNSLLMITACLALVGTVWAKEGYLVNSYTGCKFECFKLGDNDYCLRECRQQYGKGSGGYCYAFGCWCTHLYEQAVVWPLPNKTCNGK"
|
| 45 |
|
| 46 |
# Tokenize the sequence
|
| 47 |
inputs = tokenizer(sequence, return_tensors="pt")
|
|
|
|
| 52 |
logits = outputs.logits
|
| 53 |
predicted_class_id = logits.argmax().item()
|
| 54 |
|
| 55 |
+
# Define the ID to Label mapping
|
| 56 |
+
id2label = {0: 'CH', 1: 'MT', 2: 'Other', 3: 'SP', 4: 'TH'}
|
| 57 |
+
|
| 58 |
+
# Get the predicted label
|
| 59 |
+
predicted_label = id2label[predicted_class_id]
|
| 60 |
|
| 61 |
print(f"The predicted class for the sequence is: {predicted_label}")
|
| 62 |
|