You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.4 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. [![Project Status: Active – The project has reached a stable, usable
  2. state and is being actively
  3. developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
  4. [![Signed
  5. by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
  6. ![Signed commit
  7. %](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
  8. [![Linux build
  9. Status](https://travis-ci.org/hrbrmstr/swiftspeech.svg?branch=master)](https://travis-ci.org/hrbrmstr/swiftspeech)
  10. ![Minimal R
  11. Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg)
  12. ![License](https://img.shields.io/badge/License-MIT-blue.svg)
  13. # swiftspeech
  14. Classify Parts of Speech Using Apple’s CoreML and NaturalLanguage
  15. Libraries
  16. ## Description
  17. Classify Parts of Speech Using Apple’s CoreML and NaturalLanguage
  18. Libraries.
  19. ## What’s Inside The Tin
  20. The following functions are implemented:
  21. - `parts_of_speech`: Parts of speech
  22. ## Installation
  23. NOTE: This requires [{swiftr}](https://github.com/hrbrmstr/swiftr).
  24. ``` r
  25. remotes::install_git("https://git.rud.is/hrbrmstr/swiftspeech.git")
  26. # or
  27. remotes::install_gitlab("hrbrmstr/swiftspeech")
  28. # or
  29. remotes::install_bitbucket("hrbrmstr/swiftspeech")
  30. # or
  31. remotes::install_github("hrbrmstr/swiftspeech")
  32. ```
  33. NOTE: To use the ‘remotes’ install options you will need to have the
  34. [{remotes} package](https://github.com/r-lib/remotes) installed.
  35. ## Usage
  36. ``` r
  37. library(swiftspeech)
  38. # current version
  39. packageVersion("swiftspeech")
  40. ## [1] '0.1.0'
  41. ```
  42. ``` r
  43. tibble::as_tibble(parts_of_speech(paste0(c(
  44. "The comm wasn't working. Feeling increasingly ridiculous, he pushed",
  45. "the button for the 1MC channel several more times. Nothing. He opened",
  46. "his eyes and saw that all the lights on the panel were out. Then he",
  47. "turned around and saw that the lights on the refrigerator and the",
  48. "ovens were out. It wasn’t just the coffeemaker; the entire galley was",
  49. "in open revolt. Holden looked at the ship name, Rocinante, newly",
  50. "stenciled onto the galley wall, and said, Baby, why do you hurt me",
  51. "when I love you so much?"
  52. ), collapse = " ")))
  53. ## # A tibble: 92 x 2
  54. ## name tag
  55. ## <chr> <chr>
  56. ## 1 The Determiner
  57. ## 2 comm Noun
  58. ## 3 was Verb
  59. ## 4 n't Adverb
  60. ## 5 working Verb
  61. ## 6 Feeling Verb
  62. ## 7 increasingly Adverb
  63. ## 8 ridiculous Adjective
  64. ## 9 he Pronoun
  65. ## 10 pushed Verb
  66. ## # … with 82 more rows
  67. ```
  68. ## swiftspeech Metrics
  69. | Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
  70. |:-------------|---------:|-----:|----:|-----:|------------:|-----:|---------:|-----:|
  71. | Swift | 1 | 0.07 | 31 | 0.21 | 9 | 0.13 | 0 | 0.00 |
  72. | Rmd | 1 | 0.07 | 18 | 0.12 | 17 | 0.25 | 31 | 0.32 |
  73. | C | 1 | 0.07 | 13 | 0.09 | 4 | 0.06 | 1 | 0.01 |
  74. | R | 3 | 0.21 | 8 | 0.05 | 2 | 0.03 | 16 | 0.17 |
  75. | C/C++ Header | 1 | 0.07 | 4 | 0.03 | 2 | 0.03 | 0 | 0.00 |
  76. | SUM | 7 | 0.50 | 74 | 0.50 | 34 | 0.50 | 48 | 0.50 |
  77. clock Package Metrics for swiftspeech
  78. ## Code of Conduct
  79. Please note that this project is released with a Contributor Code of
  80. Conduct. By participating in this project you agree to abide by its
  81. terms.