Architecture/Back-End

[Java library] How to Use FastText4J Library

HarryNam 2020. 5. 8. 21:55
  1. Save fastest model bin file to AWS S3

  2. Import FastText4J library to Spring java project

dependency "com.github.linkfluence:fastText4j:0.2.1"
compile('com.github.linkfluence:fastText4j')
  1. get fasttext model bin file from S3(Use AWS aws-java-sdk-s3 library)

  2. load FastText class with model bin

InputStream modelBinary;

FastText fastText = FastText.loadModel(modelBinary);
  1. call predict function to get Prediction information
FastTextPrediction predictionInfo = fastText.predict(rawString);