babmakkah01 commited on
Commit
da099bb
1 Parent(s): e5f8f61

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ from arabert.preprocess import ArabertPreprocessor
3
+
4
+ processor = ArabertPreprocessor(model="aubmindlab/araelectra-base-discriminator")
5
+ pipe = pipeline("sentiment-analysis", model = "aubmindlab/aragpt2-mega-detector-long")
6
+
7
+ text = " "
8
+ text_prep = processor.preprocess(text)
9
+ result = pipe(text_prep)
10
+ # [{'label': 'machine-generated', 'score': 0.9977743625640869}]