sashtech commited on
Commit
75fc277
·
verified ·
1 Parent(s): 7a996e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -32,9 +32,13 @@ model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-unca
32
 
33
  # Initialize Gingerit for grammar correction
34
  def correct_grammar_with_gingerit(text):
35
- parser = GingerIt()
36
- result = parser.parse(text)
37
- return result['result']
 
 
 
 
38
 
39
  # AI detection function using DistilBERT
40
  def detect_ai_generated(text):
 
32
 
33
  # Initialize Gingerit for grammar correction
34
  def correct_grammar_with_gingerit(text):
35
+ try:
36
+ parser = GingerIt()
37
+ result = parser.parse(text)
38
+ return result['result']
39
+ except Exception as e:
40
+ print(f"Error in Gingerit grammar correction: {e}")
41
+ return text # Return the original text if Gingerit fails
42
 
43
  # AI detection function using DistilBERT
44
  def detect_ai_generated(text):