Metadata-Version: 2.1
Name: visual-contextual-classifier
Version: 1.2
Summary: Predicts whether a sentence is a visual sentence or a contextual sentence
Home-page: https://github.com/jgore077/visual-contextual-classifier/blob/main/README.md
Author: James Gore
Author-email: james.gore@maine.edu
Description-Content-Type: text/markdown
Requires-Dist: transformers>=4.44.2
Requires-Dist: torch>=2.4.1
Requires-Dist: requests>=2.32.3
Requires-Dist: tqdm>=4.66.5

# Visual Contextual Classifier

## Install
To install the library run this command
```
pip install visual-contextual-classifier
```
## Usage
```python
from VisualContextualClassifier import VisualContextualClassifier
# Instantiate the object (will download model files on the first creation)
classifier=VisualContextualClassifier()
classifier.predict("The sentence you want to classify")
```

## Explanation
Artwork descriptions typically have two types of sentences, visual & contextual. A visual sentence will contain words and phrases that relate to or explain the visual content of the artwork. A contextual sentence will talk about the artpiece such as the artist, the time period, or the inspirations behind the work.
### Visual
```python
classifier.predict("A vast river is laid out with a deep blue hue")
```
```javascript
{'contextual': 0.005291305482387543, 'visual': 0.9947086572647095}
```
### Contextual
```python
classifier.predict("This was the last artpiece the artist ever produced, he died 14 days after finishing this piece")
```
```javascript
{'contextual': 0.9987691044807434, 'visual': 0.0012308646691963077}
```

