public String uploadNewNERTask1(String template,List<JCas> documentsJCas,List<JCas> goldsJCas,int useSents,int useGoldSents) throws JsonProcessingException, IOException, Exception {
  Log LOG=LogFactory.getLog(getClass());
  LOG.info("Creating new Job for Ner task 1.");
  CrowdJob job=createJob(template);
  LOG.info("Done, new job id is: " + job.getId() + ". Now generating data for NER task 1");
  setAllowedCountries(job);
  crowdclient.updateAllowedCountries(job);
  int goldOffset=0;
  List<NamedEntityTask1Data> goldData=new ArrayList<NamedEntityTask1Data>();
  if (goldsJCas != null && goldsJCas.size() > 0) {
    LOG.info("Gold data available, generating gold data first.");
    goldData=generateTask1Data(goldsJCas,0,true,useGoldSents);
    goldOffset=this.lastGoldOffset;
  }
  LOG.info("Generate normal task data.");
  List<NamedEntityTask1Data> data=generateTask1Data(documentsJCas,goldOffset,false,useSents);
  List<NamedEntityTask1Data> mergedData=new ArrayList<NamedEntityTask1Data>();
  if (goldsJCas != null && goldsJCas.size() > 0) {
    mergedData.addAll(goldData);
  }
  mergedData.addAll(data);
  LOG.info("Job data prepared, starting upload.");
  LOG.info("Uploading data to job #" + job.getId());
  crowdclient.uploadData(job,mergedData);
  LOG.info("Done, finished uploading data to #" + job.getId());
  return job.getId();
}

public String uploadNewNERTask1 ( String template , List < JCas > documentsJCas , List < JCas > goldsJCas , int useSents , int useGoldSents ) throws JsonProcessingException , IOException , Exception { Log LOG = LogFactory . getLog ( getClass ( ) ) ; LOG . info ( "Creating new Job for Ner task 1." ) ; CrowdJob job = createJob ( template ) ; LOG . info ( "Done, new job id is: " + job . getId ( ) + ". Now generating data for NER task 1" ) ; setAllowedCountries ( job ) ; crowdclient . updateAllowedCountries ( job ) ; int goldOffset = 0 ; List < NamedEntityTask1Data > goldData = new ArrayList < NamedEntityTask1Data > ( ) ; if ( goldsJCas != null && goldsJCas . size ( ) > 0 ) { LOG . info ( "Gold data available, generating gold data first." ) ; goldData = generateTask1Data ( goldsJCas , 0 , true , useGoldSents ) ; goldOffset = this . lastGoldOffset ; } LOG . info ( "Generate normal task data." ) ; List < NamedEntityTask1Data > data = generateTask1Data ( documentsJCas , goldOffset , false , useSents ) ; List < NamedEntityTask1Data > mergedData = new ArrayList < NamedEntityTask1Data > ( ) ; if ( goldsJCas != null && goldsJCas . size ( ) > 0 ) { mergedData . addAll ( goldData ) ; } mergedData . addAll ( data ) ; LOG . info ( "Job data prepared, starting upload." ) ; LOG . info ( "Uploading data to job #" + job . getId ( ) ) ; crowdclient . uploadData ( job , mergedData ) ; LOG . info ( "Done, finished uploading data to #" + job . getId ( ) ) ; return job . getId ( ) ; }
upload a new ner task1 ( german ) to crowdflower . com . this method is called from the crowd page and is the starting point for a new task1 upload .
