Text Classification
Transformers
Safetensors
Spanish
English
bert
NLP
Bert
sentiment-analysis
text-embeddings-inference
Run this model with HF Jobs
Run Light-Dav/sentiment-analysis-full-project on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Light-Dav/sentiment-analysis-full-project. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Light-Dav/sentiment-analysis-full-project on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Light-Dav/sentiment-analysis-full-project with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Light-Dav/sentiment-analysis-full-project with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Light-Dav/sentiment-analysis-full-project")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Light-Dav/sentiment-analysis-full-project") model = AutoModelForSequenceClassification.from_pretrained("Light-Dav/sentiment-analysis-full-project", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download venv/Scripts/jsonpointer from Light-Dav/sentiment-analysis-full-project: direct link, hf CLI and curl.
- Browser
- Download file 1.84 kB
-
https://huggingface.co/Light-Dav/sentiment-analysis-full-project/resolve/main/venv/Scripts/jsonpointer
- Command line
-
hf download hf://Light-Dav/sentiment-analysis-full-project/venv/Scripts/jsonpointer
-
curl -L -o jsonpointer https://huggingface.co/Light-Dav/sentiment-analysis-full-project/resolve/main/venv/Scripts/jsonpointer
1.84 kB
| #!C:\Users\Light\Documents\sentiment-analysis-bert\venv\Scripts\python.exe | |
| # -*- coding: utf-8 -*- | |
| import argparse | |
| import json | |
| import sys | |
| import jsonpointer | |
| parser = argparse.ArgumentParser( | |
| description='Resolve a JSON pointer on JSON files') | |
| # Accept pointer as argument or as file | |
| ptr_group = parser.add_mutually_exclusive_group(required=True) | |
| ptr_group.add_argument('-f', '--pointer-file', type=argparse.FileType('r'), | |
| nargs='?', | |
| help='File containing a JSON pointer expression') | |
| ptr_group.add_argument('POINTER', type=str, nargs='?', | |
| help='A JSON pointer expression') | |
| parser.add_argument('FILE', type=argparse.FileType('r'), nargs='+', | |
| help='Files for which the pointer should be resolved') | |
| parser.add_argument('--indent', type=int, default=None, | |
| help='Indent output by n spaces') | |
| parser.add_argument('-v', '--version', action='version', | |
| version='%(prog)s ' + jsonpointer.__version__) | |
| def main(): | |
| try: | |
| resolve_files() | |
| except KeyboardInterrupt: | |
| sys.exit(1) | |
| def parse_pointer(args): | |
| if args.POINTER: | |
| ptr = args.POINTER | |
| elif args.pointer_file: | |
| ptr = args.pointer_file.read().strip() | |
| else: | |
| parser.print_usage() | |
| sys.exit(1) | |
| return ptr | |
| def resolve_files(): | |
| """ Resolve a JSON pointer on JSON files """ | |
| args = parser.parse_args() | |
| ptr = parse_pointer(args) | |
| for f in args.FILE: | |
| doc = json.load(f) | |
| try: | |
| result = jsonpointer.resolve_pointer(doc, ptr) | |
| print(json.dumps(result, indent=args.indent)) | |
| except jsonpointer.JsonPointerException as e: | |
| print('Could not resolve pointer: %s' % str(e), file=sys.stderr) | |
| if __name__ == "__main__": | |
| main() | |