简体   繁体   中英

What's code snippet of tf.contrib.crf.crf_log_likelihood in latest tensorflow version 2.8

The below functions existed in Tensorflow 1.5 which is currently deprecated.

What's the corresponding code for the function:

tf.contrib.crf.crf_log_likelihood()

tf.contrib.crf.viterbi_decode()

in the latest Tensorflow 2.8 version?

These both functions are now available under Tensorflow Addons package.

You can access these functions using code below:

!pip install tensorflow_addons     #to install tensorflow_addons package
import tensorflow_addons as tfa  

tfa.text.crf_log_likelihood()
tfa.text.viterbi_decode() 

Please check this link for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM