Learn R Programming

markovifyR (version 0.1002)

generate_markovify_model: Generate Markovify model

Description

Generate a markov model for a given input text and set of model parameters

Usage

generate_markovify_model(input_text, markov_state_size = 2,
  max_overlap_total = 15, max_overlap_ratio = 0.7, tries = 100)

Arguments

input_text

a vector of text

markov_state_size

markov state to use default is 2

max_overlap_total

maximum overlap total default is 15

max_overlap_ratio

maximum overlap ratio default is .7

tries

number over times to try to generate a sentence

Value

a markov model in Python object form

Examples

Run this code
# NOT RUN {
library(dplyr)
library(markovifyR)
data("linneman_lessons")
df <- linneman_lessons
lessons <-
df %>%
pull(textLesson)
markov_model <-
generate_markovify_model(
input_text = lessons,
markov_state_size = 3L,
max_overlap_total = 15,
max_overlap_ratio = .8
)
markov_model
# }

Run the code above in your browser using DataLab