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
02afd8f3
Commit
02afd8f3
authored
Sep 28, 2017
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BDD] social score / subtypes of list proposition/reflexion.
parent
98b8ae95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
ngrams.py
gargantext/models/ngrams.py
+18
-2
No files found.
gargantext/models/ngrams.py
View file @
02afd8f3
...
@@ -23,6 +23,11 @@ class Ngram(Base):
...
@@ -23,6 +23,11 @@ class Ngram(Base):
class
NodeNgram
(
Base
):
class
NodeNgram
(
Base
):
"""
For instance :
- Document - Ngram indexation
- Node of type List - Ngram indexation
"""
__tablename__
=
'nodes_ngrams'
__tablename__
=
'nodes_ngrams'
__table_args__
=
(
__table_args__
=
(
Index
(
'nodes_ngrams_node_id_ngram_id_idx'
,
'node_id'
,
'ngram_id'
),
Index
(
'nodes_ngrams_node_id_ngram_id_idx'
,
'node_id'
,
'ngram_id'
),
...
@@ -33,6 +38,17 @@ class NodeNgram(Base):
...
@@ -33,6 +38,17 @@ class NodeNgram(Base):
ngram_id
=
Column
(
Integer
,
ForeignKey
(
Ngram
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
ngram_id
=
Column
(
Integer
,
ForeignKey
(
Ngram
.
id
,
ondelete
=
'CASCADE'
),
primary_key
=
True
)
weight
=
Column
(
Float
)
weight
=
Column
(
Float
)
# List case:
# subtypename_id = Column(Integer, ForeignKey(Subtypename))
# For instance: Node can has type List
# and it subtype can be Ngrams, Sources, Authors, Classification etc.
# subsubtypename_id = Stop (0) or Map (1) or Others (2)
# social_score = Column(Integer) # incremented by one each time nodeNgram is modified
# Indexation case:
# if ngrams indexed by user : social_score ++1
# subsubtypename : null ?
node
=
relationship
(
Node
)
node
=
relationship
(
Node
)
ngram
=
relationship
(
Ngram
)
ngram
=
relationship
(
Ngram
)
...
@@ -41,12 +57,12 @@ class NodeNgram(Base):
...
@@ -41,12 +57,12 @@ class NodeNgram(Base):
class
NodeNodeNgram
(
Base
):
class
NodeNodeNgram
(
Base
):
""" for instance for TFI
DF
""" for instance for TFI
CF at doc/corpus level (TFIDF like)
(
(
doc ::Node ,
doc ::Node ,
corpus ::Node ,
corpus ::Node ,
word ::Ngram ,
word ::Ngram ,
tfidf
of ngram in doc in corpus ::Float (real)
TFICF
of ngram in doc in corpus ::Float (real)
)
)
"""
"""
__tablename__
=
'nodes_nodes_ngrams'
__tablename__
=
'nodes_nodes_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