I am new to python script i want to create sentiment analysis for the word or phrase whether the text or phrase is positive or negative.by using php post the phrase or text through $_POST['textarea'] and get in python script and check whether the phrase or text is positive or negative i want to use python nltk for example like this(pls see the link)
http://text-processing.com/demo/sentiment/
if(isset($_POST['submit']) && $_POST['submit'] == 'Analyze') {
$data = $_POST['text'];
$tmp = exec("/home/Ismath/Desktop/check.py $data");
echo $tmp;
}
//in check.py i want the word or phrase is positive and negative and neutral and how i can get the post value from textarea box in check.py if i use
import sys
print sys.argv[1]
//if i use above code suppose i enter "this is good thing" in php textarea box i got only the first text "this" only in my check.py file i want to print the whole words available in textarea box and through this word i want to check the sentence("this is good thing") is positive or negative by sentimental analysis how
?>
<body >
<div id="main">
<form action="sentiment.php" method="post" >
<div id="text-div">Enter Text:</div>
<textarea rows="12" cols="38" name="text"></textarea>
<input type="submit" name="submit" value="Analyze">
</form>
</div>
</body>
so please anyone can help me how can i proceed with this with php and python dont use the api.i wnat to create new corpus ,text in my own pls tell how can i proceed with the steps for exp my php page like this
thanks in advance