/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "absl/container/flat_hash_set.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" #include "flatbuffers/flexbuffers.h" // flatbuffer #include "tensorflow/lite/context.h" #include "tensorflow/lite/string_util.h" #include "tf_ops/skipgram_finder.h" // seq_flow_lite #include "tflite_ops/denylist.h" // seq_flow_lite namespace seq_flow_lite { namespace ops { namespace custom { namespace denylist { GetString; StringRef; // Generates prediction vectors for input strings using a skipgram denylist. // This uses the framework in `denylist.h`, with the implementation detail // that the input is a string tensor of messages and the terms are skipgrams. class SkipgramDenylistOp : public DenylistOp { … }; void* SkipgramDenylistOpInit(TfLiteContext* context, const char* buffer, size_t length) { … } } // namespace denylist TfLiteRegistration* Register_SKIPGRAM_DENYLIST() { … } } // namespace custom } // namespace ops } // namespace seq_flow_lite