title: how to run stanford corenlp server on google colab?
body: <p>I want to use stanford corenlp for obtaining dependency parser of sentences. In order to using stanford corenlp in python, we need to do the below steps:</p>
  
  <ol>
  <li>Install java</li>
  <li>Download stanford-corenlp-full-2018-10-05 and extract it.</li>
  <li>Change directory to stanford-corenlp-full-2018-10-05 folder with "cd" command.</li>
  <li>Run  this command in the current directory: 
  
  <blockquote>
    <p>"java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 75000" .</p>
  </blockquote></li>
  </ol>
  
  <p>After that, stanford-corenlp server will run at '<a href="http://localhost:9000" rel="nofollow noreferrer">http://localhost:9000</a>' .
  Finally we can call CoreNLPDependencyParser() in python script like this:</p>
  
  <pre><code>dependency_parser = CoreNLPDependencyParser(url='http://localhost:9000')
  </code></pre>
  
  <p>Now , i want to run stanford-corenlp server on google colab. I uplaoded stanford-corenlp-full-2018-10-05 folder to google drive and mount google drive on google colab. Then I installed java with below function :</p>
  
  <pre><code>import os       
  def install_java():
    !apt-get install -y openjdk-8-jdk-headless -qq &gt; /dev/null     
    os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"     
    !java -version    
  install_java()
  </code></pre>
  
  <p>Now, i don't know how run aforementioned java command and gain localhost address.</p>
  
  <p>Is there any way to do that?</p>