-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Divide ModelEvaluator class into smaller classes
The source code needs to be organized. DataSampler class needs unit tests.
- Loading branch information
Showing
36 changed files
with
59,718 additions
and
1,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
^wordpredictor\.Rproj$ | ||
^\.Rproj\.user$ | ||
^LICENSE\.md$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
.Rdata | ||
.httr-oauth | ||
.DS_Store | ||
tests/testthat/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
Package: wordpredictor | ||
Title: What the Package Does (One Line, Title Case) | ||
Version: 0.0.0.9000 | ||
Title: Develop Text Prediction Models Based On N-grams | ||
Version: 1.0.0 | ||
Authors@R: | ||
person(given = "First", | ||
family = "Last", | ||
person(given = "Nadir", | ||
family = "Latif", | ||
role = c("aut", "cre"), | ||
email = "[email protected]", | ||
comment = c(ORCID = "YOUR-ORCID-ID")) | ||
Description: What the package does (one paragraph). | ||
License: `use_mit_license()`, `use_gpl3_license()` or friends to | ||
pick a license | ||
email = "[email protected]", | ||
comment = c(ORCID = "0000-0002-7543-7405")) | ||
Description: It allows developing n-gram models for predicting text. It allows | ||
cleaning input text using various options such as removal of stop words, | ||
profanity, non-dictionary words, punctuation, stop words and stemming. | ||
It generates n-gram tokens of a given size from a text file. It also | ||
generates transition probability data for the n-grams. This data is used | ||
to predict the next word given a set of words. The model's performance can | ||
be evaluation using Perplexity (intrinsic evaluation) and | ||
accuracy (extrinsic evaluation). The package also provides methods for | ||
analyzing the n-gram model using bar plots. For example it displays plots | ||
of n-gram frequencies and plots of model performance. It provides methods | ||
for generating the n-gram model step by step or by using a single method. | ||
The performance of the generated model may be evaluated and displayed in | ||
plots. The generated model can be easily exported as a R object and used | ||
in applications. The package is implemented using R6 classes. | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.1.1 | ||
Imports: digest, ggplot2, R6, patchwork, stringr, dplyr, pryr, SnowballC, utils | ||
Suggests: | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YEAR: 2021 | ||
COPYRIGHT HOLDER: Nadir Latif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2021 Nadir Latif | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(DataAnalyzer) | ||
export(DataCleaner) | ||
export(ModelEvaluator) | ||
export(TPGenerator) | ||
export(TextFileProcessor) | ||
export(TokenGenerator) | ||
importFrom(SnowballC,wordStem) | ||
importFrom(digest,digest2int) | ||
importFrom(dplyr,group_by) | ||
importFrom(dplyr,mutate) | ||
importFrom(dplyr,summarize_all) | ||
importFrom(ggplot2,aes) | ||
importFrom(ggplot2,aes_string) | ||
importFrom(ggplot2,coord_cartesian) | ||
importFrom(ggplot2,coord_flip) | ||
importFrom(ggplot2,geom_bar) | ||
importFrom(ggplot2,geom_point) | ||
importFrom(ggplot2,geom_smooth) | ||
importFrom(ggplot2,ggplot) | ||
importFrom(ggplot2,ggtitle) | ||
importFrom(ggplot2,labs) | ||
importFrom(ggplot2,xlab) | ||
importFrom(ggplot2,xlim) | ||
importFrom(ggplot2,ylab) | ||
importFrom(patchwork,plot_annotation) | ||
importFrom(pryr,mem_change) | ||
importFrom(pryr,object_size) | ||
importFrom(stringr,str_match) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.