knowledgesrl
Thank you for checking out knowledgrsrl, our knowledge-based semantic role labeling implementation! Feel free to report GitHub issues for any question or remarks you might have.
Main entry point is knowledgesrl.py.
Requirements
To use it, install dependencies
Install also LIMA and/or SpaCy models:
$ spacy download fr_core_news_md
$ spacy download en_core_web_md
Semantic Role Labeling
To do SRL, you need a CoNLL representation of a text. Let's suppose it is in the file in.txt. To do that, you can use either LIMA:
Or SpaCy:
Then get SRL instructions with:
For example, to annotate with FrameNet a French text, use a parser to generate a ConLL file and then run:
This will output the result to the terminal. Use the --conll-output flag to write to a file.
Useful scripts
To go faster you can use the following line entering the directory where the files that you want to process are located and the spacy model you want to use:
In case you need to convert a pdf to txt:
In case you need to translate a text in english: By default it is translating from French to English
And a little script to see how many annotations have been added on your documents :
License : AGPLv3
Copyright (C) 2013-2014 CEA LIST (Guilhem Pujol, Quentin Pradet and contributors)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.