input_batch.h 919 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef NLP_SAFT_OPENSOURCE_DRAGNN_CORE_INTERFACES_INPUT_BATCH_H_
  2. #define NLP_SAFT_OPENSOURCE_DRAGNN_CORE_INTERFACES_INPUT_BATCH_H_
  3. #include <string>
  4. #include <vector>
  5. #include "syntaxnet/base.h"
  6. namespace syntaxnet {
  7. namespace dragnn {
  8. // An InputBatch object converts strings into a given data type. It is used to
  9. // abstract DRAGNN internal data typing. Each internal DRAGNN data type should
  10. // subclass InputBatch, with a public accessor to the type in question.
  11. class InputBatch {
  12. public:
  13. virtual ~InputBatch() {}
  14. // Set the data to translate to the subclass' data type.
  15. virtual void SetData(const std::vector<string> &data) = 0;
  16. // Translate the underlying data back to a vector of strings, as appropriate.
  17. virtual const std::vector<string> GetSerializedData() const = 0;
  18. };
  19. } // namespace dragnn
  20. } // namespace syntaxnet
  21. #endif // NLP_SAFT_OPENSOURCE_DRAGNN_CORE_INTERFACES_INPUT_BATCH_H_