Views
No views yet
LogicSpine/address-large-text-classifier is a fine-tuned version of the cross-encoder/nli-roberta-base model, specifically designed for address classification tasks using zero-shot learning. It allows you to classify text related to addresses and locations without the need for direct training on every possible label.transformers library:pip install transformers torchfrom transformers import pipeline
# Load the zero-shot classification pipeline with the custom model
classifier = pipeline("zero-shot-classification",
model="LogicSpine/address-large-text-classifier")
# Define your input text and candidate labels
text = "Delhi, India"
candidate_labels = ["Country", "Department", "Laboratory", "College", "District", "Academy"]
# Perform classification
result = classifier(text, candidate_labels)
# Print the classification result
print(result){'labels': ['Country',
'District',
'Academy',
'College',
'Department',
'Laboratory'],
'scores': [0.19237062335014343,
0.1802321970462799,
0.16583585739135742,
0.16354037821292877,
0.1526614874601364,
0.14535939693450928],
'sequence': 'Delhi, India'}