Skip to content

python 默认加载的是lite模型么? #107

Open

Description

@joyeJ

如题。python 默认加载的是lite模型么?

Activity

  1. joyeJ commented on Jan 13, 2021

    @joyeJ
    Author

    是不是Model1呀?

  2. secsilm commented on Mar 13, 2021

    @secsilm

    看了看源码,加载的哪个模型要看 seg_only 的值了(默认 False):

    • True -> cws_model.bin;
    • False -> model_c_model.bin

    见

    if(self.__seg_only):
    self.__cws_tagging_decoder = CBTaggingDecoder()
    self.__cws_tagging_decoder.init((self.__prefix+"cws_model.bin"), (self.__prefix+"cws_dat.bin"),(self.__prefix+"cws_label.txt"))
    self.__cws_tagging_decoder.threshold = 0
    self.__cws_tagging_decoder.separator = self.__separator
    self.__cws_tagging_decoder.setLabelTrans()
    else:
    self.__tagging_decoder = CBTaggingDecoder()
    self.__tagging_decoder.init((self.__prefix+"model_c_model.bin"),(self.__prefix+"model_c_dat.bin"),(self.__prefix+"model_c_label.txt"))
    self.__tagging_decoder.threshold = 10000
    self.__tagging_decoder.separator = self.__separator
    self.__tagging_decoder.setLabelTrans()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions