code: public BinaryClassificationFMeasure train(String corpus, int maxIteration, boolean averagePerceptron)
      {
          FeatureMap featureMap = new LockableFeatureMap(new TagSet(TaskType.CLASSIFICATION));
          featureMap.mutable = true; // 训练时特征映射可拓充
          Instance[] instanceList = readInstance(corpus, featureMap);
          model = averagePerceptron ? trainAveragedPerceptron(instanceList, featureMap, maxIteration)
              : trainNaivePerceptron(instanceList, featureMap, maxIteration);
          featureMap.mutable = false; // 训练结束后特征不可写
          return evaluate(instanceList);
      }
docs: 训练
  
  @param corpus            语料库
  @param maxIteration      最大迭代次数
  @param averagePerceptron 是否使用平均感知机算法
  @return 模型在训练集上的准确率