Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
9ee3d71d
Commit
9ee3d71d
authored
Aug 26, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DEBUG Taggers + Stemmers info
parent
903e78c0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
3 deletions
+17
-3
RIS.py
gargantext/util/parsers/RIS.py
+1
-1
ngram_groups.py
gargantext/util/toolchain/ngram_groups.py
+2
-0
ngrams_extraction.py
gargantext/util/toolchain/ngrams_extraction.py
+2
-0
parsing.py
gargantext/util/toolchain/parsing.py
+11
-2
projects.py
gargantext/views/pages/projects.py
+1
-0
No files found.
gargantext/util/parsers/RIS.py
View file @
9ee3d71d
...
...
@@ -30,7 +30,7 @@ class RISParser(Parser):
}
def
parse
(
self
,
file
):
print
(
"=====> PARSING RIS"
)
hyperdata
=
{}
last_key
=
None
last_values
=
[]
...
...
gargantext/util/toolchain/ngram_groups.py
View file @
9ee3d71d
...
...
@@ -50,9 +50,11 @@ def compute_groups(corpus, stoplist_id = None, overwrite_id = None):
# 1) compute stems/lemmas
# and group if same stem/lemma
stemmers
=
prepare_stemmers
(
corpus
)
print
(
"# STEMMERS LOADED"
,
stemmers
)
supported_stemmers_lang
=
[
lang
for
lang
in
corpus
.
hyperdata
[
"languages"
]
\
if
lang
!=
"__unknown__"
\
and
lang
in
LANGUAGES
.
keys
()]
print
(
"#SUPPORTED STEMMERS LANGS"
,
supported_stemmers_lang
)
# todo dict {lg => {ngrams_todo} }
todo_ngrams_per_lg
=
defaultdict
(
set
)
...
...
gargantext/util/toolchain/ngrams_extraction.py
View file @
9ee3d71d
...
...
@@ -53,7 +53,9 @@ def extract_ngrams(corpus, keys=DEFAULT_INDEX_FIELDS, do_subngrams = DEFAULT_IND
#print(LANGUAGES.keys())
tagger_bots
=
{
lang
:
load_tagger
(
lang
)
for
lang
in
corpus
.
hyperdata
[
"languages"
]
\
if
lang
!=
"__unknown__"
and
lang
in
LANGUAGES
.
keys
()}
print
(
"#TAGGERS LOADED: "
,
tagger_bots
)
supported_taggers_lang
=
tagger_bots
.
keys
()
print
(
"#SUPPORTED TAGGER LANGS"
,
supported_taggers_lang
)
#sort docs by lang?
# for lang, tagger in tagger_bots.items():
for
documents_count
,
document
in
enumerate
(
corpus
.
children
(
'DOCUMENT'
)):
...
...
gargantext/util/toolchain/parsing.py
View file @
9ee3d71d
...
...
@@ -143,13 +143,22 @@ def parse(corpus):
#les jolis iso2
observed_langs
=
dict
(
Counter
(
observed_languages
))
# les documents
print
(
corpus
.
children
(
"DOCUMENT"
)
.
count
(),
"docs parsed"
)
docs
=
corpus
.
children
(
"DOCUMENT"
)
.
count
()
if
docs
==
0
:
print
(
"[WARNING] PARSING FAILED!!!!!"
)
corpus
.
status
(
'Parsing'
,
error
=
"No documents parsed"
)
#document.save_hyperdata()
print
(
docs
,
"parsed"
)
#LANGUAGES INFO
print
(
"#LANGAGES OK"
)
print
(
observed_langs
)
print
(
"#LANGUAGES UNKNOWN"
)
print
(
skipped_langs
)
corpus
.
hyperdata
[
"language_id"
]
=
sorted
(
observed_langs
.
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)[
0
][
0
]
top_langs
=
sorted
(
observed_langs
.
items
(),
key
=
lambda
x
:
x
[
1
],
reverse
=
True
)
if
len
(
top_langs
)
>
0
:
corpus
.
hyperdata
[
"language_id"
]
=
top_langs
[
0
][
0
]
else
:
corpus
.
hyperdata
[
"language_id"
]
=
"__unknown__"
print
(
"#MAIN language of the CORPUS"
,
corpus
.
hyperdata
[
"language_id"
])
corpus
.
hyperdata
[
"languages"
]
=
dict
(
observed_langs
)
...
...
gargantext/views/pages/projects.py
View file @
9ee3d71d
...
...
@@ -81,6 +81,7 @@ class NewCorpusForm(forms.Form):
def
project
(
request
,
project_id
):
# current user
user
=
cache
.
User
[
request
.
user
.
id
]
# viewed project
project
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
project_id
)
.
first
()
if
project
is
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment