Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
Encoding sentences with Setenece BERT's model in FastAPI changes the result from the results with Jupyter and python scripts

System

  • macbook pro
  • OSX 10.15.5(Catalina)
  • Docker version 19.03.12, build 48a66213fe

Library

  • uvicorn==0.11.8
  • fastapi==0.61.0
  • torch==1.6.0
  • transformers==3.0.2
  • sentence-transformers==0.3.2
  • scikit-learn==0.20.0
  • scipy==1.4.1
  • pandas==0.23.4
  • jupyter==1.0.0

Detail

I used Colaboratory to fine-tune Setence BERT and save that model. Then I went local and built an environment with Docker that included jupyter and FastAPI, and in that environment I was able to confirm that the model I saved with Jupyter, launched in Docker, returned the same estimation results as in the Collaboratory. When I used that model, I got different results when I used FastAPI started in the same Docker environment as Jupyter. All the text entered in this flow is the same.

The analysis showed that the SentenceTransformer loaded the model and then encoded it, and found that it calculated completely different embedding.

Thanks to your advice.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

sorry, I use Japanese model but I forgat translate default BertTokenizer to BertJapaneseTokenizer.

Change default Tokenizer fixed this problem.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda