#include "mediapipe/tasks/cc/text/text_classifier/text_classifier.h"
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "mediapipe/framework/api2/builder.h"
#include "mediapipe/framework/packet.h"
#include "mediapipe/tasks/cc/components/containers/classification_result.h"
#include "mediapipe/tasks/cc/components/containers/proto/classifications.pb.h"
#include "mediapipe/tasks/cc/components/processors/proto/classifier_options.pb.h"
#include "mediapipe/tasks/cc/core/task_api_factory.h"
#include "mediapipe/tasks/cc/text/text_classifier/proto/text_classifier_graph_options.pb.h"
#include "tensorflow/lite/core/api/op_resolver.h"
namespace mediapipe {
namespace tasks {
namespace text {
namespace text_classifier {
namespace {
ConvertToClassificationResult;
using ::mediapipe::tasks::components::containers::proto::ClassificationResult;
constexpr char kTextStreamName[] = …;
constexpr char kTextTag[] = …;
constexpr char kClassificationsStreamName[] = …;
constexpr char kClassificationsTag[] = …;
constexpr char kSubgraphTypeName[] = …;
CalculatorGraphConfig CreateGraphConfig(
std::unique_ptr<proto::TextClassifierGraphOptions> options) { … }
std::unique_ptr<proto::TextClassifierGraphOptions>
ConvertTextClassifierOptionsToProto(TextClassifierOptions* options) { … }
}
absl::StatusOr<std::unique_ptr<TextClassifier>> TextClassifier::Create(
std::unique_ptr<TextClassifierOptions> options) { … }
absl::StatusOr<TextClassifierResult> TextClassifier::Classify(
absl::string_view text) { … }
}
}
}
}