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
4c6e600f
Commit
4c6e600f
authored
Dec 24, 2015
by
Janez K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new triplet extraction widget
parent
d059fbdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
workflows/streaming/library.py
workflows/streaming/library.py
+17
-1
workflows/streaming/package_data/widgets/1e16b03c-a64b-4907-9a1a-11c84073a70b.json
...ge_data/widgets/1e16b03c-a64b-4907-9a1a-11c84073a70b.json
+56
-0
No files found.
workflows/streaming/library.py
View file @
4c6e600f
...
...
@@ -6,6 +6,8 @@ Streaming widgets librarby
'''
from
workflows.security
import
safeOpen
from
workflows.streaming.tripletclient
import
TripletClient
def
streaming_add_neutral_zone
(
input_dict
):
import
copy
...
...
@@ -295,7 +297,21 @@ def streaming_triplet_wordnet_lemmatizer(input_dict,widget,stream=None):
new_triplets
.
append
(
new_triplet
)
output_dict
=
{}
output_dict
[
'triplets'
]
=
new_triplets
return
output_dict
return
output_dict
def
streaming_triplet_extraction_2
(
input_dict
,
widget
,
stream
=
None
):
output_dict
=
{}
text
=
input_dict
[
'text'
]
t
=
TripletClient
()
triplets
=
t
.
reverb
(
text
)
new_triplets
=
[]
for
extraction
in
triplets
[
'extractions'
]:
triplet
=
[
extraction
[
'arg1'
].
lower
(),
extraction
[
'relNorm'
].
lower
(),
extraction
[
'arg2'
].
lower
()]
new_triplets
.
append
(
triplet
)
output_dict
[
'triplets'
]
=
new_triplets
return
output_dict
def
streaming_triplet_extraction
(
input_dict
,
widget
,
stream
=
None
):
from
pysimplesoap.client
import
SoapClient
,
SoapFault
...
...
workflows/streaming/package_data/widgets/1e16b03c-a64b-4907-9a1a-11c84073a70b.json
0 → 100644
View file @
4c6e600f
[
{
"model"
:
"workflows.abstractwidget"
,
"fields"
:
{
"category"
:
"ca549cd5-2041-46f1-b175-a743b71b0e9b"
,
"treeview_image"
:
""
,
"uid"
:
"1e16b03c-a64b-4907-9a1a-11c84073a70b"
,
"windows_queue"
:
false
,
"package"
:
"streaming"
,
"interaction_view"
:
""
,
"has_progress_bar"
:
false
,
"image"
:
""
,
"description"
:
"Extracts triplets from sentences."
,
"static_image"
:
"triplets.png"
,
"action"
:
"streaming_triplet_extraction_2"
,
"visualization_view"
:
""
,
"streaming_visualization_view"
:
""
,
"post_interact_action"
:
""
,
"wsdl_method"
:
""
,
"wsdl"
:
""
,
"interactive"
:
false
,
"is_streaming"
:
true
,
"order"
:
1
,
"name"
:
"Triplet Extraction (ver 2)"
}
},
{
"model"
:
"workflows.abstractinput"
,
"fields"
:
{
"widget"
:
"1e16b03c-a64b-4907-9a1a-11c84073a70b"
,
"name"
:
"Text"
,
"short_name"
:
"str"
,
"default"
:
""
,
"description"
:
"Sentences to extract triplets from."
,
"required"
:
false
,
"multi"
:
false
,
"parameter_type"
:
null
,
"variable"
:
"text"
,
"parameter"
:
false
,
"order"
:
1
,
"uid"
:
"5e8999ac-6b8c-45ec-9089-3c4f93f24f08"
}
},
{
"model"
:
"workflows.abstractoutput"
,
"fields"
:
{
"widget"
:
"1e16b03c-a64b-4907-9a1a-11c84073a70b"
,
"name"
:
"Triplets"
,
"short_name"
:
"tri"
,
"description"
:
"Triplets"
,
"variable"
:
"triplets"
,
"order"
:
1
,
"uid"
:
"df2091c8-502f-4930-9d11-1b1b148bb060"
}
}
]
\ No newline at end of file
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