Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
fbc1dbea
Commit
fbc1dbea
authored
Dec 19, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DATABASE] New Table for postagging
parent
8404a553
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
2 deletions
+87
-2
schema.sql
devops/postgres/schema.sql
+16
-0
PosTagging.hs
src/Gargantext/Core/Text/Terms/Multi/PosTagging.hs
+1
-1
Ngrams.hs
src/Gargantext/Database/Schema/Ngrams.hs
+1
-1
NgramsPostag.hs
src/Gargantext/Database/Schema/NgramsPostag.hs
+69
-0
No files found.
devops/postgres/schema.sql
View file @
fbc1dbea
...
@@ -39,6 +39,8 @@ CREATE TABLE public.nodes (
...
@@ -39,6 +39,8 @@ CREATE TABLE public.nodes (
);
);
ALTER
TABLE
public
.
nodes
OWNER
TO
gargantua
;
ALTER
TABLE
public
.
nodes
OWNER
TO
gargantua
;
--------------------------------------------------------------
-- | Ngrams
CREATE
TABLE
public
.
ngrams
(
CREATE
TABLE
public
.
ngrams
(
id
SERIAL
,
id
SERIAL
,
terms
CHARACTER
varying
(
255
),
terms
CHARACTER
varying
(
255
),
...
@@ -47,6 +49,20 @@ CREATE TABLE public.ngrams (
...
@@ -47,6 +49,20 @@ CREATE TABLE public.ngrams (
);
);
ALTER
TABLE
public
.
ngrams
OWNER
TO
gargantua
;
ALTER
TABLE
public
.
ngrams
OWNER
TO
gargantua
;
-- | Ngrams PosTag
CREATE
TABLE
public
.
ngrams_postag
(
id
SERIAL
,
lang_id
INTEGER
,
algo_id
INTEGER
,
postag
CHARACTER
varying
(
5
),
ngrams_id
INTEGER
NOT
NULL
,
lemm_id
INTEGER
NOT
NULL
,
score
INTEGER
DEFAULT
1
::
integer
NOT
NULL
,
FOREIGN
KEY
(
ngrams_id
)
REFERENCES
public
.
ngrams
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
lemm_id
)
REFERENCES
public
.
ngrams
(
id
)
ON
DELETE
CASCADE
);
ALTER
TABLE
public
.
ngrams_postag
OWNER
TO
gargantua
;
--------------------------------------------------------------
--------------------------------------------------------------
CREATE
TABLE
public
.
node_ngrams
(
CREATE
TABLE
public
.
node_ngrams
(
id
SERIAL
,
id
SERIAL
,
...
...
src/Gargantext/Core/Text/Terms/Multi/PosTagging.hs
View file @
fbc1dbea
...
@@ -115,7 +115,7 @@ corenlp' lang txt = do
...
@@ -115,7 +115,7 @@ corenlp' lang txt = do
let
properties
=
case
lang
of
let
properties
=
case
lang
of
EN
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,ner
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
EN
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,ner
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
-- FR -> "{\"annotators\": \"tokenize,ssplit,pos,ner\", \"outputFormat\": \"json\"}"
-- FR -> "{\"annotators\": \"tokenize,ssplit,pos,ner\", \"outputFormat\": \"json\"}"
FR
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,ner
\"
,
\"
parse.model
\"
:
\"
edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz
\"
,
\"
pos.model
\"
:
\"
edu/stanford/nlp/models/pos-tagger/french/french.tagger
\"
,
\"
tokenize.language
\"
:
\"
fr
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
FR
->
"{
\"
annotators
\"
:
\"
tokenize,ssplit,pos,
lemma,
ner
\"
,
\"
parse.model
\"
:
\"
edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz
\"
,
\"
pos.model
\"
:
\"
edu/stanford/nlp/models/pos-tagger/french/french.tagger
\"
,
\"
tokenize.language
\"
:
\"
fr
\"
,
\"
outputFormat
\"
:
\"
json
\"
}"
_
->
panic
$
pack
"not implemented yet"
_
->
panic
$
pack
"not implemented yet"
url
<-
parseRequest
$
"POST http://localhost:9000/?properties="
<>
properties
url
<-
parseRequest
$
"POST http://localhost:9000/?properties="
<>
properties
let
request
=
setRequestBodyLBS
(
cs
txt
)
url
let
request
=
setRequestBodyLBS
(
cs
txt
)
url
...
...
src/Gargantext/Database/Schema/Ngrams.hs
View file @
fbc1dbea
{-|
{-|
Module : Gargantext.Database.Schema.Ngrams
Module : Gargantext.Database.Schema.Ngrams
Postag
Description : Ngram connection to the Database
Description : Ngram connection to the Database
Copyright : (c) CNRS, 2017-Present
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
License : AGPL + CECILL v3
...
...
src/Gargantext/Database/Schema/NgramsPostag.hs
0 → 100644
View file @
fbc1dbea
{-|
Module : Gargantext.Database.Schema.NgramsPostag
Description : Ngram connection to the Database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
Each Ngrams has a pos-tagging version to ease the default groups of
ngrams in NgramsTerm Lists.
-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Schema.NgramsPostag
where
import
Data.Text
(
Text
)
import
Gargantext.Prelude
import
Gargantext.Database.Schema.Prelude
data
NgramsPosTagPoly
id
lang_id
algo_id
postag
ngrams_id
lemm_id
score
=
NgramsPosTagDB
{
_ngramsPosTag_id
::
!
id
,
_ngramsPosTag_lang_id
::
!
lang_id
,
_ngramsPosTag_algo_id
::
!
algo_id
,
_ngramsPosTag_postag
::
!
postag
,
_ngramsPosTag_ngrams_id
::
!
ngrams_id
,
_ngramsPosTag_lemm_id
::
!
lemm_id
,
_ngramsPosTag_score
::
!
score
}
deriving
(
Show
)
------------------------------------------------------------------------
type
NgramsPosTagWrite
=
NgramsPosTagPoly
(
Maybe
(
Column
PGInt4
))
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Maybe
(
Column
PGText
))
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Maybe
(
Column
PGInt4
))
type
NgramsPosTagRead
=
NgramsPosTagPoly
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGText
)
(
Column
PGInt4
)
(
Column
PGInt4
)
(
Column
PGInt4
)
type
NgramsPosTagReadNull
=
NgramsPosTagPoly
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGText
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
type
NgramsPosTagDB
=
NgramsPosTagPoly
Int
Int
Int
Text
Int
Int
Int
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