Lingua::NegEx - Perl extension for finding negated phrases in text.
use Lingua::NegEx; my $scope = negation_scope( 'There is no pulmonary embolism.' ); print $scope; # prints '3 - 4'
This is a perl implementation of Wendy Chapman's NegEx algorithm which uses a list of phrases to determine whether clinical conditions are negated in a sentence.
EXPORT
negation_scope( $text );
The NegEx documentation and downloads for java implementation can be found here:
http://code.google.com/p/negex/
The one exported function, negation_scope(), takes a sentence as inuput and returns '-1' if no negation is found or returns the index of the words that make up the scope of the negation.
Eduardo Iturrate, <ed@iturrate.com>
Copyright (C) 2013 by Eduardo Iturrate
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Lingua::NegEx, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::NegEx
CPAN shell
perl -MCPAN -e shell install Lingua::NegEx
For more information on module installation, please visit the detailed CPAN module installation guide.