Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web-openccg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ease-ph
DeepLanguageUnderstanding
web-openccg
Commits
41980379
Unverified
Commit
41980379
authored
6 years ago
by
Sebastian Höffner
Browse files
Options
Downloads
Patches
Plain Diff
Integrating with grammar from openccg-gum-cooking.
parent
2039da8d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+11
-6
11 additions, 6 deletions
Dockerfile
webopenccg/wccg.py
+2
-1
2 additions, 1 deletion
webopenccg/wccg.py
with
13 additions
and
7 deletions
Dockerfile
+
11
−
6
View file @
41980379
...
...
@@ -4,6 +4,9 @@ LABEL maintainer="Sebastian Höffner <shoeffner@tzi.de>"
LABEL
description="A small webapp to parse sentences using the DiaSpace grammar (University of Bremen) with OpenCCG."
LABEL
version="2.1"
ARG
GRAMMAR_VERSION=master
ARG
OPENCCG_VERSION=0.9.5
EXPOSE
5000 8080
ENV
OPENCCG_HOME /openccg
...
...
@@ -11,13 +14,15 @@ ENV PATH "$OPENCCG_HOME/bin:$PATH"
ENV
LD_LIBRARY_PATH "$OPENCCG_HOME/lib:$LD_LIBRARY_PATH"
# Download and extract OpenCCG
RUN
curl
-o
openccg-
0.9.5
.tgz https://datapacket.dl.sourceforge.net/project/openccg/openccg/openccg%20v
0.9.5
%20-%20deplen%2C%20kenlm%2C%20disjunctivizer/openccg-
0.9.5
.tgz
\
&&
tar
zxf openccg-
0.9.5
.tgz
\
&&
rm
openccg-
0.9.5
.tgz
\
RUN
curl
-o
openccg-
${
OPENCCG_VERSION
}
.tgz https://datapacket.dl.sourceforge.net/project/openccg/openccg/openccg%20v
${
OPENCCG_VERSION
}
%20-%20deplen%2C%20kenlm%2C%20disjunctivizer/openccg-
${
OPENCCG_VERSION
}
.tgz
\
&&
tar
zxf openccg-
${
OPENCCG_VERSION
}
.tgz
\
&&
rm
openccg-
${
OPENCCG_VERSION
}
.tgz
\
# Download and extract grammar
&& curl -O http://www.diaspace.uni-bremen.de/twiki/pub/DiaSpace/ReSources/english.zip \
&& unzip -d /english english.zip \
&& rm english.zip \
&& curl -O -L https://github.com/shoeffner/openccg-gum-cooking/archive/${GRAMMAR_VERSION}.zip \
&& unzip -d /tmp ${GRAMMAR_VERSION}.zip \
&& mv /tmp/openccg-gum-cooking-${GRAMMAR_VERSION}/english-cooking /grammar \
&& rm ${GRAMMAR_VERSION}.zip \
&& rm -rf /tmp/openccg-gum-cooking-${GRAMMAR_VERSION} \
# Download viz.js
&& mkdir -p /app/webopenccg/static \
&& curl -L -o /app/webopenccg/static/viz.js https://github.com/mdaines/viz.js/releases/download/v2.0.0/viz.js \
...
...
This diff is collapsed.
Click to expand it.
webopenccg/wccg.py
+
2
−
1
View file @
41980379
import
itertools
import
os
import
re
import
string
import
subprocess
...
...
@@ -25,7 +26,7 @@ def parse(sentence):
if
not
sentence
:
return
dict
(
error
=
'
No sentence provided.
'
,
http_status
=
400
)
wccg_proc
=
subprocess
.
Popen
([
'
wccg
'
,
'
-showsem
'
,
'
-showall
'
,
'
/english
'
],
wccg_proc
=
subprocess
.
Popen
([
'
wccg
'
,
'
-showsem
'
,
'
-showall
'
,
os
.
environ
.
get
(
'
GRAMMAR_DIR
'
,
'
/grammar
'
)
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment