Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Commit-Analysis-ML
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ahmad, Rawel
Commit-Analysis-ML
Commits
ad3c15a9
Commit
ad3c15a9
authored
1 year ago
by
Rawel
Browse files
Options
Downloads
Patches
Plain Diff
Added tqdm for better progress tracking
parent
ccd860db
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classifier/BagOfWords.py
+5
-2
5 additions, 2 deletions
Classifier/BagOfWords.py
with
5 additions
and
2 deletions
Classifier/BagOfWords.py
+
5
−
2
View file @
ad3c15a9
...
...
@@ -5,6 +5,7 @@ import subprocess
from
joblib
import
dump
from
sklearn.feature_extraction.text
import
CountVectorizer
,
TfidfTransformer
from
tqdm
import
tqdm
class
BagOfWords
:
...
...
@@ -21,8 +22,10 @@ class BagOfWords:
def
create_bag_of_words
():
all_words
=
open
(
"
words.c
"
,
"
w+
"
)
for
path
in
glob
.
glob
(
"
Training/vccs/**/*.json
"
,
recursive
=
True
)
+
glob
.
glob
(
"
Training/unclassified/**/*.json
"
,
recursive
=
True
for
path
in
tqdm
(
glob
.
glob
(
"
Training/vccs/**/*.json
"
,
recursive
=
True
)
+
glob
.
glob
(
"
Training/unclassified/**/*.json
"
,
recursive
=
True
),
desc
=
"
Creating bag of words
"
,
):
with
open
(
path
,
"
r+
"
)
as
json_file
:
raw_data
=
json
.
load
(
json_file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment