在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ropensci/googleLanguageR开源软件地址(OpenSource Url):https://github.com/ropensci/googleLanguageR开源编程语言(OpenSource Language):R 80.7%开源软件介绍(OpenSource Introduction):googleLanguageR - R client for the Google Translation API, Natural Language API, Speech-to-Text API and Text-to-Speech APILanguage tools for R via Google Machine Learning APIsRead the introduction blogpost on rOpenSci's blog This package contains functions for analysing language through the Google Cloud Machine Learning APIs Note all are paid services, you will need to provide your credit card details for your own Google Project to use them. The package can be used by any user who is looking to take advantage of Google’s massive dataset to train these machine learning models. Some applications include:
The applications of the API results could be relevant to business or researchers looking to scale text analysis. Google Natural Language API
Read more on the Google Natural Language API Google Cloud Translation API
Read more on the Google Cloud Translation Website Google Cloud Speech-to-Text API
Read more on the Google Cloud Speech Website Google Cloud Text-to-Speech API
Read more on the Google Cloud Text-to-Speech Website Installation
Docker imageSome Docker images are publicly available. In general
UsageAuthenticationThe best way to authenticate is to use an environment file. See
Set the file location of your download Google Project JSON file in a
Then, when you load the library you should auto-authenticate: library(googleLanguageR) You can also authenticate directly using the library(googleLanguageR)
gl_auth("location_of_json_file.json") You can then call the APIs via the functions:
Natural Language APIThe Natural Language API returns natural language understanding technolgies. You can call them individually, or the default is to return them all. The available returns are:
Demo for Entity AnalysisYou can pass a vector of text which will call the API for each element. The return is a list of responses, each response being a list of tibbles holding the different types of analysis. texts <- c("to administer medicince to animals is frequently a very difficult matter, and yet sometimes it's necessary to do so",
"I don't know how to make a text demo that is sensible")
nlp_result <- gl_nlp(texts)
# two results of lists of tibbles
str(nlp_result, max.level = 2) See more examples and details on the
website
or via Google Translation APIYou can detect the language via Note this is a lot more refined than the free version on Google’s translation website. text <- "to administer medicine to animals is frequently a very difficult matter, and yet sometimes it's necessary to do so"
## translate British into Danish
gl_translate(text, target = "da")$translatedText See more examples and details on the
website
or via Google Cloud Speech-to-Text APIThe Cloud Speech-to-Text API provides audio transcription. Its
accessible via the A test audio file is installed with the package which reads:
The file is sourced from the University of Southampton’s speech
detection ( ## get the sample source file
test_audio <- system.file("woman1_wb.wav", package = "googleLanguageR")
## its not perfect but...:)
gl_speech(test_audio)$transcript
## # A tibble: 1 x 2
## transcript confidence
## <chr> <chr>
## 1 to administer medicine to animals is frequency of very diffi… 0.9180294 See more examples and details on the
website
or via Google Cloud Text-to-Speech APIThe Cloud Text-to-Speech API turns text into talk audio files. Its
accessible via the To use, supply your text to the function: gl_talk("This is a talking computer. Hello Dave.") See more examples and details on the
website
or via |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论