Stanford-Core-NLP giving Java errors for text tokenization










0














So I'm trying to run to tokenize the text using StanfordCore NLP for text summarization using this git repo. I have set the environment variables for Java-8 and I'm using python 2.7. When I run this command :



echo "This is text tokenization" | java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class


It works fine and gives output as :




"This



is



text



tokenization"




But when I'm using the command:



python make_datafiles.py /path/to/cnn/stories /path/to/dailymail/stories.


I get this error :



'"java -cp"' is not recognized as an internal or external command,
operable program or batch file.
Exception: The tokenized stories directory cnn_stories_tokenized contains 0 files, but it should contain the same number as C:UsersHarshitDownloadscnn_stories_tokenizedcnn_stories_tokenized (which has 92579 files). Was there an error during tokenization?


How do I solve this and tokenize the datafiles ?










share|improve this question




























    0














    So I'm trying to run to tokenize the text using StanfordCore NLP for text summarization using this git repo. I have set the environment variables for Java-8 and I'm using python 2.7. When I run this command :



    echo "This is text tokenization" | java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class


    It works fine and gives output as :




    "This



    is



    text



    tokenization"




    But when I'm using the command:



    python make_datafiles.py /path/to/cnn/stories /path/to/dailymail/stories.


    I get this error :



    '"java -cp"' is not recognized as an internal or external command,
    operable program or batch file.
    Exception: The tokenized stories directory cnn_stories_tokenized contains 0 files, but it should contain the same number as C:UsersHarshitDownloadscnn_stories_tokenizedcnn_stories_tokenized (which has 92579 files). Was there an error during tokenization?


    How do I solve this and tokenize the datafiles ?










    share|improve this question


























      0












      0








      0







      So I'm trying to run to tokenize the text using StanfordCore NLP for text summarization using this git repo. I have set the environment variables for Java-8 and I'm using python 2.7. When I run this command :



      echo "This is text tokenization" | java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class


      It works fine and gives output as :




      "This



      is



      text



      tokenization"




      But when I'm using the command:



      python make_datafiles.py /path/to/cnn/stories /path/to/dailymail/stories.


      I get this error :



      '"java -cp"' is not recognized as an internal or external command,
      operable program or batch file.
      Exception: The tokenized stories directory cnn_stories_tokenized contains 0 files, but it should contain the same number as C:UsersHarshitDownloadscnn_stories_tokenizedcnn_stories_tokenized (which has 92579 files). Was there an error during tokenization?


      How do I solve this and tokenize the datafiles ?










      share|improve this question















      So I'm trying to run to tokenize the text using StanfordCore NLP for text summarization using this git repo. I have set the environment variables for Java-8 and I'm using python 2.7. When I run this command :



      echo "This is text tokenization" | java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class


      It works fine and gives output as :




      "This



      is



      text



      tokenization"




      But when I'm using the command:



      python make_datafiles.py /path/to/cnn/stories /path/to/dailymail/stories.


      I get this error :



      '"java -cp"' is not recognized as an internal or external command,
      operable program or batch file.
      Exception: The tokenized stories directory cnn_stories_tokenized contains 0 files, but it should contain the same number as C:UsersHarshitDownloadscnn_stories_tokenizedcnn_stories_tokenized (which has 92579 files). Was there an error during tokenization?


      How do I solve this and tokenize the datafiles ?







      java python stanford-nlp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 11:33









      octano

      208415




      208415










      asked Nov 12 at 11:18









      Sheril Dev

      134




      134






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Can you please check that java path is properly configured or not?



          Steps to check java path:



          1. Go to cmd.

          2. java -version

          3. java version should come in the screen like "java version 1.x.xxx"

          4. If not, then please configure java path.
            You can take help from below link to configure java path
            Environment variables for java installation





          share|improve this answer




















          • Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
            – Sheril Dev
            Nov 12 at 12:34











          • Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
            – JavaSat
            Nov 12 at 16:31










          • Please provide me the content present in make_datafiles.py file.
            – JavaSat
            Nov 12 at 16:34










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261057%2fstanford-core-nlp-giving-java-errors-for-text-tokenization%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Can you please check that java path is properly configured or not?



          Steps to check java path:



          1. Go to cmd.

          2. java -version

          3. java version should come in the screen like "java version 1.x.xxx"

          4. If not, then please configure java path.
            You can take help from below link to configure java path
            Environment variables for java installation





          share|improve this answer




















          • Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
            – Sheril Dev
            Nov 12 at 12:34











          • Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
            – JavaSat
            Nov 12 at 16:31










          • Please provide me the content present in make_datafiles.py file.
            – JavaSat
            Nov 12 at 16:34















          0














          Can you please check that java path is properly configured or not?



          Steps to check java path:



          1. Go to cmd.

          2. java -version

          3. java version should come in the screen like "java version 1.x.xxx"

          4. If not, then please configure java path.
            You can take help from below link to configure java path
            Environment variables for java installation





          share|improve this answer




















          • Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
            – Sheril Dev
            Nov 12 at 12:34











          • Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
            – JavaSat
            Nov 12 at 16:31










          • Please provide me the content present in make_datafiles.py file.
            – JavaSat
            Nov 12 at 16:34













          0












          0








          0






          Can you please check that java path is properly configured or not?



          Steps to check java path:



          1. Go to cmd.

          2. java -version

          3. java version should come in the screen like "java version 1.x.xxx"

          4. If not, then please configure java path.
            You can take help from below link to configure java path
            Environment variables for java installation





          share|improve this answer












          Can you please check that java path is properly configured or not?



          Steps to check java path:



          1. Go to cmd.

          2. java -version

          3. java version should come in the screen like "java version 1.x.xxx"

          4. If not, then please configure java path.
            You can take help from below link to configure java path
            Environment variables for java installation






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 at 12:16









          JavaSat

          42




          42











          • Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
            – Sheril Dev
            Nov 12 at 12:34











          • Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
            – JavaSat
            Nov 12 at 16:31










          • Please provide me the content present in make_datafiles.py file.
            – JavaSat
            Nov 12 at 16:34
















          • Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
            – Sheril Dev
            Nov 12 at 12:34











          • Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
            – JavaSat
            Nov 12 at 16:31










          • Please provide me the content present in make_datafiles.py file.
            – JavaSat
            Nov 12 at 16:34















          Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
          – Sheril Dev
          Nov 12 at 12:34





          Java is coming to be alright. Something like this: java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
          – Sheril Dev
          Nov 12 at 12:34













          Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
          – JavaSat
          Nov 12 at 16:31




          Can you give the full java path in command like below? echo "This is text tokenization" | /usr/java/jdk1.8.0_20/bin/java -cp C:UsersHarshitDownloadsstanford-corenlp-full-2016-10-31stanford-corenlp-full-2016-10-31stanford-corenlp-3.7.0.jar edu.stanford.nlp.process.PTBTokenizer.class
          – JavaSat
          Nov 12 at 16:31












          Please provide me the content present in make_datafiles.py file.
          – JavaSat
          Nov 12 at 16:34




          Please provide me the content present in make_datafiles.py file.
          – JavaSat
          Nov 12 at 16:34

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261057%2fstanford-core-nlp-giving-java-errors-for-text-tokenization%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3

          Museum of Modern and Contemporary Art of Trento and Rovereto