Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Statistical_Grammar_Checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NLP_WS_2021
Statistical_Grammar_Checker
Merge requests
!12
Update grammar_checker.py
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update grammar_checker.py
stheraib-main-patch-83607
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Heiko Raible
requested to merge
stheraib-main-patch-83607
into
main
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
e9438e41
1 commit,
3 years ago
1 file
+
2
−
8
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
deployment/grammar_checker.py
+
2
−
8
Options
import
ast
import
sys
import
time
import
json
import
json
import
math
import
nltk
import
nltk
import
requests
import
requests
import
pandas
as
pd
import
threading
import
threading
import
numpy
as
np
import
numpy
as
np
from
nltk
import
TweetTokenizer
from
nltk.util
import
ngrams
from
time
import
sleep
from
time
import
sleep
from
tester
import
Tester
from
tester
import
Tester
@@ -274,7 +267,8 @@ class GrammarChecker:
@@ -274,7 +267,8 @@ class GrammarChecker:
i_errors
.
append
(
index
)
i_errors
.
append
(
index
)
max_counter
=
counter
max_counter
=
counter
print
(
f
"
thresholds_passed:
{
thresholds_passed
}
"
)
print
(
f
"
below thresholds? bi-gram:
{
thresholds_passed
[
2
]
}
, tri-gram:
{
thresholds_passed
[
3
]
}
"
)
print
(
"
notice: sentence level thresholds ignored. we currently always assume an error.
"
)
return
i_errors
return
i_errors
Loading