Beispiel #1
0
    def post(self):
        """Process text with EIDOS and return biology INDRA Statements.

        Parameters
        ----------
        text : str
            The text to be processed.

        webservice : Optional[str]
            An Eidos reader web service URL to send the request to.
            If None, the reading is assumed to be done with the Eidos JAR
            rather than via a web service. Default: None

        Returns
        -------
        statements : list[indra.statements.Statement.to_json()]
            A list of extracted INDRA Statements.
        """
        args = request.json
        text = args.get('text')
        webservice = args.get('webservice')
        if not webservice:
            abort(400, 'No web service address provided.')
        ep = eidos.process_text_bio(text, webservice=webservice)
        return _stmts_from_proc(ep)
Beispiel #2
0
def test_process_text_bio():
    ep = eidos.process_text_bio('virus increases death')
    assert ep is not None
    assert len(ep.statements) == 1
    stmt = ep.statements[0]
    from indra.statements import Activation
    assert isinstance(stmt, Activation)
Beispiel #3
0
def test_process_text_bio(mock_read):
    mock_read.return_value = _read_eidos_sentence_json()
    ep = eidos.process_text_bio('virus increases death')
    assert ep is not None
    assert len(ep.statements) == 1
    stmt = ep.statements[0]
    from indra.statements import Activation
    assert isinstance(stmt, Activation)