whole_sentence_features.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright 2017 Google Inc. All Rights Reserved.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==============================================================================*/
  12. // Features for whole Sentence objects. Contrast with SentenceFeature, which
  13. // operates on tokens within Sentences.
  14. #include "syntaxnet/feature_extractor.h"
  15. #ifndef SYNTAXNET_WHOLE_SENTENCE_FEATURES_H_
  16. #define SYNTAXNET_WHOLE_SENTENCE_FEATURES_H_
  17. namespace syntaxnet {
  18. // Type of feature functions whose focus is a whole sentence.
  19. typedef FeatureFunction<Sentence> WholeSentenceFeatureFunction;
  20. // Utilities to register the two types of parser features.
  21. #define REGISTER_WHOLE_SENTENCE_FEATURE_FUNCTION(name, type) \
  22. REGISTER_SYNTAXNET_FEATURE_FUNCTION(WholeSentenceFeatureFunction, name, type)
  23. } // namespace syntaxnet
  24. #endif // SYNTAXNET_WHOLE_SENTENCE_FEATURES_H_