Views
No views yet
1#Importing Required Classes and Functions
2from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
3
4
5#Loading the Pre-trained Tokenizer
6tokenizer = AutoTokenizer.from_pretrained("CommunicationStyle/Communication_Style")
7
8#Loading the Pre-trained Model
9model = AutoModelForSequenceClassification.from_pretrained("CommunicationStyle/Communication_Style")
10
11
12# Creating the Communication Style Classification Pipeline
13pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
14
15# Using the Pipeline to Classify Text
16# detail can be found: https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline
17# pipe("input the text here"). Example as below:
18
19print(pipe("We care about what we bring to our stakeholders"))
20print(pipe("Put your money to work at an incremental return to your IRR"))