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
85f8dd96
Commit
85f8dd96
authored
Mar 03, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refactoring-rom' into refactoring-alex
parents
375735e5
36a68044
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
ngrams.py
gargantext/models/ngrams.py
+18
-1
No files found.
gargantext/models/ngrams.py
View file @
85f8dd96
...
...
@@ -2,7 +2,7 @@ from gargantext.util.db import *
from
.nodes
import
Node
__all__
=
[
'Ngram'
,
'NodeNgram'
,
'NodeNgramNgram'
]
__all__
=
[
'Ngram'
,
'NodeNgram'
,
'NodeN
odeNgram'
,
'NodeN
gramNgram'
]
class
Ngram
(
Base
):
...
...
@@ -18,6 +18,23 @@ class NodeNgram(Base):
ngram_id
=
Column
(
Integer
,
ForeignKey
(
Ngram
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
weight
=
Column
(
Float
)
class
NodeNodeNgram
(
Base
):
""" for instance for tfidf:
(
doc ::Node ,
corpus ::Node ,
word ::Ngram ,
tfidf of ngram in doc in corpus ::Float (real)
)
"""
__tablename__
=
'nodes_nodes_ngrams'
node1_id
=
Column
(
Integer
,
ForeignKey
(
Node
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
node2_id
=
Column
(
Integer
,
ForeignKey
(
Node
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
ngram_id
=
Column
(
Integer
,
ForeignKey
(
Ngram
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
score
=
Column
(
Float
(
precision
=
24
))
# précision max 24 bit pour un type sql "real" (soit 7 chiffres après virgule)
# sinon par défaut on aurait un type sql "double_precision" (soit 15 chiffres)
# (cf. www.postgresql.org/docs/9.4/static/datatype-numeric.html#DATATYPE-FLOAT)
class
NodeNgramNgram
(
Base
):
__tablename__
=
'nodes_ngrams_ngrams'
...
...
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