safetensors bert text-classification license:apache-2.0 region:us
---
license: apache-2.0
pipeline_tag: text-classification
---
---
tags:
  - transformers
  - pytorch
  - bert
  - pregnancy-classifier
---

# BERT Pregnancy Classifier

This model uses a BERT-based architecture to classify whether the given text suggests pregnancy or not. It is trained to process textual input and classify it into pregnancy-related categories.

## Model Details
- **Type**: Sequence Classification
- **Framework**: PyTorch
- **License**: [Your License Here]
- **Language**: English

## How to Use

You can use this model with the Hugging Face `transformers` library. Below is an example of how to load and use the model for text classification:

```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer

# Load the model and tokenizer
model_name = "livhoungh/bert_pregnancy_classifier"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Example input text
input_text = "Your example text for pregnancy classification."

# Tokenize the input text
inputs = tokenizer(input_text, return_tensors="pt")

# Get model predictions
with torch.no_grad():
    outputs = model(**inputs)

# Extract logits and make predictions
logits = outputs.logits
predictions = logits.argmax(dim=-1)
print("Predicted class:", predictions.item())
Intended Use
Applications: Pregnancy-related text classification for medical research, health tech, or other relevant fields.
Limitations
The model is designed for English text classification. It might not perform well on non-English inputs or specialized medical terms outside the training domain.