Tuesday, July 9, 2019

hate php file

<!DOCTYPE html>
<html>
<title>Hate Speech Detection</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-blue-grey.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Open+Sans'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html,body,h1,h2,h3,h4,h5 {font-family: "Open Sans", sans-serif}
textarea {
  width: 100%;
 
}
</style>
<body class="w3-theme-l5">

<!-- Navbar -->
<div class="w3-top">
 <div class="w3-bar w3-theme-d2 w3-left-align w3-large">
  <a class="w3-bar-item w3-button w3-hide-medium w3-hide-large w3-right w3-padding-large w3-hover-white w3-large w3-theme-d2" href="javascript:void(0);" onclick="openNav()"><i class="fa fa-bars"></i></a>
  <a href="#" class="w3-bar-item w3-button w3-padding-large w3-theme-d4"><i class="fa fa-home w3-margin-right"></i>Hate Speech Detection</a>
 
  <a href="#" class="w3-bar-item w3-button w3-hide-small w3-right w3-padding-large w3-hover-white" title="My Account">
    <img src="mypic.jpg" class="w3-circle" style="height:30px;width:30px" alt="Avatar">
  </a>
 </div>
</div>

<!-- Navbar on small screens -->
<div id="navDemo" class="w3-bar-block w3-theme-d2 w3-hide w3-hide-large w3-hide-medium w3-large">
  <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 1</a>
  <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 2</a>
  <a href="#" class="w3-bar-item w3-button w3-padding-large">Link 3</a>
  <a href="#" class="w3-bar-item w3-button w3-padding-large">Muhammad U. S. Khan</a>
</div>

<!-- Page Container -->
<div class="w3-container w3-content" style="max-width:1400px;margin-top:80px">   
  <!-- The Grid -->
  <div class="w3-row">
    <!-- Left Column -->
    <div class="w3-col m3">
      <!-- Profile -->
      <div class="w3-card w3-round w3-white">
        <div class="w3-container">
         <h4 class="w3-center">Muhammad U. S. Khan</h4>
         <p class="w3-center"><img src="mypic.jpg" class="w3-circle" style="height:106px;width:106px" alt="Avatar"></p>
         <hr>
         <p><i class="fa fa-pencil fa-fw w3-margin-right w3-text-theme"></i> Postdoc Researcher, UEF</p>
         <p><i class="fa fa-home fa-fw w3-margin-right w3-text-theme"></i> Joensuu, Finland</p>
         <!--<p><i class="fa fa-birthday-cake fa-fw w3-margin-right w3-text-theme"></i> </p>-->
        </div>
      </div>
      <br>
     
      <!-- Accordion -->
      <div class="w3-card w3-round">
        <div class="w3-white">
          <button onclick="myFunction('Demo1')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-circle-o-notch fa-fw w3-margin-right"></i> My Groups</button>
          <div id="Demo1" class="w3-hide w3-container">
            <p>Machine learning group</p>
          </div>
          <button onclick="myFunction('Demo2')" class="w3-button w3-block w3-theme-l1 w3-left-align"><i class="fa fa-calendar-check-o fa-fw w3-margin-right"></i> My Events</button>
          <div id="Demo2" class="w3-hide w3-container">
            <p>Something big in the future</p>
          </div>
         
        </div>     
      </div>
      <br>
     
      <!-- Interests -->
      <div class="w3-card w3-round w3-white w3-hide-small">
        <div class="w3-container">
          <p>Interests</p>
          <p>
            <span class="w3-tag w3-small w3-theme-d5">Machine learning</span>
            <span class="w3-tag w3-small w3-theme-d4">Artificial Intelligence</span>
            <span class="w3-tag w3-small w3-theme-d3">Big data</span>
            <span class="w3-tag w3-small w3-theme-d2">Social media analysis</span>
          </p>
        </div>
      </div>
      <br>
     
      <!-- Alert Box -->
 
    <!-- End Left Column -->
    </div>
   
    <!-- Middle Column -->
    <div class="w3-col m7">
   
      <div class="w3-row-padding">
        <div class="w3-col m12">
          <div class="w3-card w3-round w3-white">
            <div class="w3-container w3-padding">
              <h6 class="w3-opacity">Hate Speech Detection</h6>
  <form action="index.php">
              <textarea class="w3-border w3-padding" rows="4" cols="50" name="nString" >Enter Text</textarea>
             
  <input type="submit" class="w3-button w3-theme" value="Check hate probability">
  </form>
            </div>
          </div>
        </div>
      </div>
     
      <div class="w3-container w3-card w3-white w3-round w3-margin"><br>
       
        <span class="w3-right w3-opacity">1 min</span>
        <h4>Result</h4><br>
        <hr class="w3-clear">
        <p>
<?php

if(isset($_GET['nString'])){
//#print $_GET["nString"]; print "<br>";
$str = $_GET["nString"];
$retval = NULL;
$output = NULL;

    exec("python3 /home/tko/usman/web-docs/hate/cnn2d-model2-dataset1-loadvocab-2.py $str 2>&1",$output, $retval);
 
   print '<table align="center">';
   $length = count($output);
for ($i = 1; $i < $length; $i++) {
  print '<tr><td>';
  print $output[$i];
  print "<br>";
  print '</td></tr>';
}
  print '</table >';
}
else{
   print ""
}
?>

</p>
          <div class="w3-row-padding" style="margin:0 -16px">
           
        </div>
       
      </div>
     
     
     
    <!-- End Middle Column -->
    </div>
   
    <!-- Right Column -->
    <div class="w3-col m2">
      <div class="w3-card w3-round w3-white ">
        <div class="w3-container">
          <p>Tool is based on a neural network model</p>
          <p><strong>that find probabilities of</strong></p>
          <p>hate, offensive, and neutrality of any given english language tweet</p>
          <!--<p><button class="w3-button w3-block w3-theme-l4">Info</button></p>-->
        </div>
      </div>
      <br>
     
     
     
     
      <br>
     
      <!--<div class="w3-card w3-round w3-white w3-padding-32 w3-center">
        <p><i class="fa fa-bug w3-xxlarge"></i></p>
      </div>-->
     
    <!-- End Right Column -->
    </div>
   
  <!-- End Grid -->
  </div>
 
<!-- End Page Container -->
</div>
<br>

<!-- Footer -->
<footer class="w3-container w3-theme-d3 w3-padding-16">

</footer>

<footer class="w3-container w3-theme-d5">
 
</footer>

<script>
// Accordion
function myFunction(id) {
    var x = document.getElementById(id);
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
        x.previousElementSibling.className += " w3-theme-d1";
    } else {
        x.className = x.className.replace("w3-show", "");
        x.previousElementSibling.className =
        x.previousElementSibling.className.replace(" w3-theme-d1", "");
    }
}

// Used to toggle the menu on smaller screens when clicking on the menu button
function openNav() {
    var x = document.getElementById("navDemo");
    if (x.className.indexOf("w3-show") == -1) {
        x.className += " w3-show";
    } else {
        x.className = x.className.replace(" w3-show", "");
    }
}
</script>

</body>
</html>

No comments:

Post a Comment