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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
0d2c688f
Commit
0d2c688f
authored
Jan 31, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[john snow] add cache volume in docker-compose, fix "message" Maybe
parent
3edc87d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
docker-compose.yaml
devops/docker/docker-compose.yaml
+3
-0
JohnSnowNLP.hs
src/Gargantext/Utils/JohnSnowNLP.hs
+3
-3
No files found.
devops/docker/docker-compose.yaml
View file @
0d2c688f
...
...
@@ -37,8 +37,11 @@ services:
johnsnownlp
:
image
:
'
johnsnowlabs/nlp-server:latest'
volumes
:
-
js-cache:/home/johnsnowlabs/cache_pretrained
ports
:
-
5000:5000
volumes
:
garg-pgdata
:
js-cache
:
src/Gargantext/Utils/JohnSnowNLP.hs
View file @
0d2c688f
...
...
@@ -15,7 +15,7 @@ module Gargantext.Utils.JohnSnowNLP where
import
Control.Concurrent
(
threadDelay
)
import
Control.Lens
import
Data.Aeson
(
encode
,
ToJSON
,
toJSON
,
FromJSON
,
parseJSON
,
Value
(
..
),
(
.:
))
import
Data.Aeson
(
encode
,
ToJSON
,
toJSON
,
FromJSON
,
parseJSON
,
Value
(
..
),
(
.:
)
,
(
.:?
)
)
import
Data.Aeson.Types
(
prependFailure
,
typeMismatch
)
import
Data.Aeson.TH
(
deriveJSON
)
import
qualified
Data.List.Safe
as
LS
...
...
@@ -89,7 +89,7 @@ instance FromJSON JSAsyncTaskStatus where
parseJSON
(
Object
v
)
=
do
status
<-
v
.:
"status"
code
<-
status
.:
"code"
message
<-
status
.:
"message"
message
<-
status
.:
?
"message"
pure
$
JSAsyncTaskStatus
{
_jsAsyncTaskStatus_code
=
code
,
_jsAsyncTaskStatus_message
=
message
}
parseJSON
s
=
...
...
@@ -176,7 +176,7 @@ waitForJsTask jsTask = wait' 0
panic
"[waitForJsTask] waited for 1 minute and still no answer from JohnSnow NLP"
else
do
printDebug
"[waitForJsTask] task not ready, waiting"
counter
_
<-
threadDelay
$
100000
*
1
_
<-
threadDelay
$
100000
0
*
1
wait'
$
counter
+
1
getPosTagAndLems
::
Lang
->
Text
->
IO
PosSentences
...
...
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