Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments #226

Open
brianvoe opened this issue Dec 26, 2022 · 6 comments
Open

Comments #226

brianvoe opened this issue Dec 26, 2022 · 6 comments

Comments

@brianvoe
Copy link
Owner

Add ability to generate a comment. Look at variations of types of comments and see if we can replicate them as best as possible

@se-omar
Copy link
Contributor

se-omar commented Jan 19, 2024

I'm looking into this.

first thought I have is to have types of comments (product reviews, facebook comments, etc?)
and then create basic templates for each of them to follow, then fill the template with a list of chosen words for each type.

so this example for product review explains it:

func generateRandomReview() string {
    templates := []string{
        "I really %s this %s, especially its %s. However, %s.",
        "As a long-time user of %s, I think it's %s.",
    }

    likeDislike := []string{"like", "love", "dislike", "hate"}
    products := []string{"smartphone", "headphones", "laptop"}
    features := []string{"battery life", "sound quality", "durability"}
    additionalComments := []string{"I would definitely recommend it!", "It could be better."}
    qualityDescriptors := []string{"amazing", "decent", "superb", "disappointing"}

    rand.Seed(time.Now().UnixNano())
    template := templates[rand.Intn(len(templates))]
    comment := fmt.Sprintf(template,
        likeDislike[rand.Intn(len(likeDislike))],
        products[rand.Intn(len(products))],
        features[rand.Intn(len(features))],
        additionalComments[rand.Intn(len(additionalComments))])

    return comment
}

@se-omar
Copy link
Contributor

se-omar commented Jan 19, 2024

I also came across something called article spinning, we can use this to generate our comment.
I found this package gospin that does exactly that.

@brianvoe
Copy link
Owner Author

I already put something together last night. but i havent merged it into master yet so open to suggestions if you have something better.

I agree with having a variation of different comment types. With somewhat more defined sentences like your example. Cause what i have now is basically more gibberish.

@brianvoe
Copy link
Owner Author

4ab4a51

Dont worry about making changes if you come up with something better. its just a string return so no worries if we completely change it later.

@se-omar
Copy link
Contributor

se-omar commented Jan 19, 2024

Okk, I'll look at it later after this release.

@brianvoe
Copy link
Owner Author

ok released! lets see if you can come up with something better. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants