religious_org_v1
14
license:apache-2.0
by
GivingTuesday
Other
OTHER
New
14 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
snapshot_download will return / print a location for the model. Pass that into the function below.texttransformers
repo_id = 'GivingTuesday/religious_org_v1'
from huggingface_hub import snapshot_download
snapshot_download(repo_id)
# snapshot_download will return / print a location for the model. Pass that into the function below.
from transformers import pipeline
# 1. Define the local path to your downloaded model directory
# Replace './my_local_model_directory' with the actual path on your machine
model_path = './my_local_model_directory' # copied from output of previous cell
# 2. Load the text classification pipeline from the local directory
# The 'pipeline' function automatically loads the model, tokenizer, and config
# from the specified local path.
try:
classifier = pipeline(
task="text-classification",
model=model_path,
tokenizer=model_path
)
print(f"Model loaded successfully from {model_path}")
except Exception as e:
print(f"Error loading model: {e}")
print("Please ensure the directory contains the model weights, config, and tokenizer files.")
exit()
# 3. Define the string(s) you want to classify
sentences = [
"""St. John's Episcopal is a really beautiful community that preaches "faith in action" -- they welcome and assist migrants, partner with community organizations, run a housing first apartment building for unhoused folks, and they are part of the Together Colorado coalition of faith-based organizations that lobbies for anti-poverty legislation. Bonus: the cathedral is gorgeous and historic.""",
"""I’m atheist but rehearse in a community choir at Christ Church United Methodist and they have pro LGBTQ+ stuff everywhere. They even do a reconciliation Sunday service every year in June during pride month""",
]
# 4. Run the classification on the input string(s)
results = classifier(sentences)
# 5. Print the results
for i, result in enumerate(results):
print(f"\nText: '{sentences[i]}'")
print(f"Classification Results:")
# Results can be a list of dictionaries if top_k is used
if isinstance(result, list):
for label_info in result:
print(f"- Label: {label_info['label']}, Score: {label_info['score']:.4f}")
else:
print(f"- Label: {result['label']}, Score: {result['score']:.4f}")Output (actual reddit comments):text
Text: 'St. John's Episcopal is a really beautiful community that preaches "faith in action" -- they welcome and assist migrants, partner with community organizations, run a housing first apartment building for unhoused folks, and they are part of the Together Colorado coalition of faith-based organizations that lobbies for anti-poverty legislation. Bonus: the cathedral is gorgeous and historic.'
Classification Results:
- Label: Christianity, Score: 0.8822
Text: 'I’m atheist but rehearse in a community choir at Christ Church United Methodist and they have pro LGBTQ+ stuff everywhere. They even do a reconciliation Sunday service every year in June during pride month'
Classification Results:
- Label: Christianity, Score: 0.9899Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.