SmartTag provides methods to tag text from figure legends based on the SourceData model.
See also:
SourceData - a semantic platform for curating and searching figures.
Liechti R, George N, Götz L, El-Gebali S, Chasapi A, Crespo I, Xenarios I, Lemberger T.
Nature Methods (2017) 14:1021 doi:10.1038/nmeth.4471
Demonstration of SmartTag:
https://smtag.sourcedata.io/api/v1/
Method to perform the complete tagging of a text, including panel segmentation, typed entity tagging and role prediction.
Request: GET
| POST
/smtag
URL Params:
text=[string]
(required): the text to processformat=['html' (default) |'xml']
(optional): the format of the output.tag=['sd-tag' (default)|'sd-pretag']
: the element/class used to tag entities; set to ‘sd-tag’ by default.Examples:
$ curl 'https://smtag.sourcedata.io/api/v1/smtag?text=A%20Creb1-/-%20cell.&format=xml&tag=sd-pretag'
<smtag><sd-panel><sd-pretag type="organism" type_score="62">A</sd-pretag> <sd-pretag type="geneprod" role="intervention" type_score="96" role_score="91">Creb1</sd-pretag>-/- cell.</sd-panel></smtag>
$ curl 'https://smtag.sourcedata.io/api/v1/smtag?text=A%20Creb1-/-%20cell.&format=html'
<ul><li class="sd-panel">A <span class="sd-tag geneprod type_score_9 intervention role_score_8">Creb1</span>-/- cell.</li></ul>
Method to tag entities.
Request: GET
| POST
/entity
URL Params:
text=[string]
(required): the text to processformat=['html' (default) |'xml']
(optional): the format of the output.tag=['sd-tag' (default)|'sd-pretag']
: the element/class used to tag entities; set to ‘sd-tag’ by default.Examples:
$ curl 'https://smtag.sourcedata.io/api/v1/entity?text=A%20Creb1-/-%20cell.&format=xml&tag=sd-pretag'
<smtag>A <sd-tag type="geneprod" type_score="68">Jun</sd-tag>-/- cell.</smtag>
curl 'https://smtag.sourcedata.io/api/v1/entity?text=A%20Creb1-/-%20cell.&format=html'
A <span class="sd-tag geneprod type_score_9">Creb1</span>-/- cell.
Method to predict the roles from pretagged content.
Request: GET
| POST
/role
URL Params:
pretagged=[xml_string]
(required): the pretagged content as xmltag=[sd-tag|sd-pretag (default)]
(optional): the element that needs to be updated; set to ‘sd-pretag’ by defaultExamples:
curl -G 'https://smtag.sourcedata.io/api/v1/role' --data-urlencode 'pretagged=<something><sd-tag type="geneprod">Atg4</sd-tag> levels in <sd-pretag type="geneprod" category="" type_score="68" irrelevant_attr="hello">Creb1</sd-pretag>-/- cell.</something>'
<something><sd-tag type='geneprod'>Atg4</sd-tag> levels in <sd-pretag irrelevant_attr='hello' type_score='68' role='intervention' type='geneprod' category=''>Creb1</sd-pretag>-/- cell.</something>
Note: only elements are updated.
curl -G 'https://smtag.sourcedata.io/api/v1/role' --data-urlencode 'pretagged=<something><sd-tag type="geneprod">Atg4</sd-tag> levels in <sd-pretag type="geneprod" type_score="68" irrelevant_attr="hello">Creb1</sd-pretag>-/- cell.</something>' --data 'tag=sd-tag'
<something><sd-tag type='geneprod' role='assayed'>Atg4</sd-tag> levels in <sd-pretag irrelevant_attr='hello' type='geneprod' type_score='68'>Creb1</sd-pretag>-/- cell.</something>
Note: only sd-tag is updated because of the tag=sd-tag parameter
Notes:
<sd-pretag category="">
elements are updated, the rest of the elements are left untouchedtag
parameter, only these elements are updated (but without any constraint on attributes)@role
with the default value @role='component'
is added to all the updated elements.@type='geneprod'
or @type='molecule'
, the attribute @role='intervention'
or @role='assayed'
may be added based on the predicted role.Method to tag entities.
Request: GET
| POST
/tag
URL Params:
text=[string]
(required): the text to processformat=['html' (default) |'xml']
(optional): the format of the output.tag=[sd-tag (default)|sd-pretag]
(optional): the element/class used to tag entities; set to ‘sd-tag’ by default.Examples:
$ curl 'https://smtag.sourcedata.io/api/v1/tag?text=A%20Creb1-/-%20cell.&format=xml'
smtag>A <sd-tag type="geneprod" role="intervention" type_score="95" role_score="75">Creb1</sd-tag>-/- cell.</smtag>
$ curl 'https://smtag.sourcedata.io/api/v1/tag?text=A%20Creb1-/-%20cell.&format=html&tag=pre-tag'
A <span class="pre-tag geneprod type_score_9 intervention role_score_9">Creb1</span>-/- cell.
Method to split the text of a figure legend into individual panels.
Request: GET
| POST
/panelize
URL Params:
text=[string]
(required): the text to processformat=['html' (default) |'xml']
(optional): the format of the output.Examples:
https://smtag.sourcedata.io/api/v1/panelizer?text=(A)%20This%20is%20a%20panel.%20(B)%20This%20is%20differnt%20from%20(A)%20or%20(C).%20(C,%20D)%20The%20rest.&format=xml
<smtag>
<sd-panel>(A) This is a panel.</sd-panel>
<sd-panel>(B) This is differnt from (A) or (C).</sd-panel>
<sd-panel>(C, D) The rest.</sd-panel>
</smtag>
https://smtag.sourcedata.io/api/v1/panelizer?text=(A)%20This%20is%20a%20panel.%20(B)%20This%20is%20differnt%20from%20(A)%20or%20(C).%20(C,%20D)%20The%20rest.&format=html
<ul>
<li class="sd-panel">(A) This is a panel. </li>
<li class="sd-panel">(B) This is differnt from (A) or (C). </li>
<li class="sd-panel">(C, D) The rest.</li>
</ul>