Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clowdflows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Shakour
clowdflows
Commits
525c0a6b
Commit
525c0a6b
authored
Oct 10, 2013
by
Anze Vavpetic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added server code for def.ex. with wnet and patterns
parent
77ba410a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
workflows/nlp/library.py
workflows/nlp/library.py
+20
-7
No files found.
workflows/nlp/library.py
View file @
525c0a6b
...
...
@@ -77,20 +77,28 @@ def nlp_term_extraction(input_dict):
lang
=
input_dict
[
'lang'
]
wsdl
=
input_dict
.
get
(
'wsdl'
,
'http://vihar.ijs.si:8095/totale?wsdl'
)
ws
=
WebService
(
wsdl
,
60000
)
response
=
ws
.
client
.
TermExtraction
(
corpus
=
annotations
,
lang
=
lang
,
threshold
=
0
)
response
=
ws
.
client
.
TermExtraction
(
corpus
=
annotations
,
lang
=
lang
,
threshold
=
0
)
return
{
'candidates'
:
response
[
'candidates'
]}
def
nlp_def_extraction_
term
s
(
input_dict
):
def
nlp_def_extraction_
pattern
s
(
input_dict
):
'''
Definition extraction using
term
s.
Definition extraction using
pre-defined pattern
s.
'''
pass
annotations
=
input_dict
[
'annotations'
]
lang
=
input_dict
[
'lang'
]
wsdl
=
input_dict
.
get
(
'wsdl'
,
'http://vihar.ijs.si:8095/totale?wsdl'
)
ws
=
WebService
(
wsdl
,
60000
)
pattern
=
input_dict
[
'pattern'
]
response
=
ws
.
client
.
GlossaryExtractionByWnet
(
corpus
=
annotations
,
lang
=
lang
,
pattern
=
pattern
)
return
{
'sentences'
:
response
[
'candidates'
]}
def
nlp_def_extraction_
pattern
s
(
input_dict
):
def
nlp_def_extraction_
term
s
(
input_dict
):
'''
Definition extraction using
pre-defined pattern
s.
Definition extraction using
term
s.
'''
pass
...
...
@@ -99,4 +107,9 @@ def nlp_def_extraction_wnet(input_dict):
'''
Definition extraction using WordNet.
'''
pass
annotations
=
input_dict
[
'annotations'
]
lang
=
input_dict
[
'lang'
]
wsdl
=
input_dict
.
get
(
'wsdl'
,
'http://vihar.ijs.si:8095/totale?wsdl'
)
ws
=
WebService
(
wsdl
,
60000
)
response
=
ws
.
client
.
GlossaryExtractionByWnet
(
corpus
=
annotations
,
lang
=
lang
)
return
{
'sentences'
:
response
[
'candidates'
]}
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