Views
No views yet
1from transformers import BertConfig, AutoTokenizer
2from modeling_bert_regression import BertForRegression
3
4tokenizer = AutoTokenizer.from_pretrained("zks2856/PairQual-Scorer-en")
5config = BertConfig.from_pretrained("zks2856/PairQual-Scorer-en")
6model = BertForRegression.from_pretrained("zks2856/PairQual-Scorer-en", config=config, trust_remote_code=True)
7
8text = "This is a test sentence."
9inputs = tokenizer(text, return_tensors="pt", padding="longest", truncation=True)
10pooled, score = model(**inputs)
11
12print(score)You are a professional evaluator of Chinese text quality. Please assess the quality of the texts based on the following criteria:
Readability and Coherence: Consider whether the text is fluent, easy to understand, free of formatting issues or gibberish, and uses appropriate grammar and vocabulary.
Educational Value: Consider whether the text contains sufficient and accurate scientific knowledge and objective facts, has educational significance for humans, and avoids logical contradictions or false information.
Data Cleanliness: Consider whether the text has been cleaned of noise, off-topic content, personal sensitive information, advertisements, links, copyright notices, etc.
Based on these criteria, evaluate the quality of the following two texts. The texts may have been truncated, so do not let length or order influence your judgment.
Text 0:
{{text0}}
Text 1:
{{text1}}
Please output only the index of the higher-quality text. Do not output anything else.