summaryrefslogtreecommitdiff
path: root/rst_parser/dep_training.h
blob: 3eeee22ef1a9e7a8cf8d470c32f77a1f5311fb1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _DEP_TRAINING_H_
#define _DEP_TRAINING_H_

#include <iostream>
#include <string>
#include <vector>
#include "arc_factored.h"
#include "weights.h"

struct TrainingInstance {
  TaggedSentence ts;
  EdgeSubset tree;
  SparseVector<weight_t> features;
  // reads a "Jsent" formatted dependency file
  static bool ReadInstance(std::istream* in, TrainingInstance* instance); // returns false at EOF
  static void ReadTrainingCorpus(const std::string& fname, std::vector<TrainingInstance>* corpus, int rank = 0, int size = 1);
};

#endif