SimpleNLG is a programming library for natural language generation (NLG) in Java
Questions tagged [simplenlg]
15 questions
5
votes
1 answer
SimpleNLG - How to get the plural of a noun?
I'm using SimpleNLG 4.4.2 to get plural form for a noun:
final XMLLexicon xmlLexicon = new XMLLexicon();
final WordElement word = xmlLexicon.getWord("apple",…

Fluffy
- 27,504
- 41
- 151
- 234
4
votes
1 answer
SimpleNLG: how we specify the quantity?
My question is how to specify the quantity in a noun phrase?
For example:
NPPhraseSpec np = nlgFactory.createNounPhrase("", "apple");
How to generate "5 apples", for example?
A solution is to put a preModifier, the code would be:
Lexicon…

Karim
- 133
- 5
3
votes
1 answer
NLG - Create text descriptions with simplenlg
I'm trying to generate product descriptions with the help of NLG. For example if I specify the properties of the product(say a mobile phone) such as its OS, RAM, processor, display, battery etc., It should output me a readable description of the…

Master Po
- 1,497
- 1
- 23
- 42
3
votes
2 answers
SimpleNLG - Is it possible to have SimpleNLG automatically detect if a noun is singular or plural?
The following SimpleNLG code which specifies the subject, verb and object using "monkeys", "eat", "bananas", respectively produces the sentence "monkey eats bananas". Thus, you see that it converted the plural nouns into singular ones (and ensured…

blu
- 829
- 2
- 7
- 14
1
vote
0 answers
How to generate an interrogative "WHAT_OBJECT" phrase using SimpleNLG in Python3?
I would generate this question "What are the colors of lightsabers?".
I'm using the direct port of the java code of SimpleNLG in python and my version of python is 3.11.
This is my wrong solution, which generates "What are lightsaber the colors…

edoardo
- 11
- 2
1
vote
1 answer
How to Extract subject Verb Object using NLP Java? for every sentence
I want to find a subject, verb, and object for each sentence and then it will be passed to natural language generation library simpleNLG to form a sentence.
I tried multiple libraries like Cornlp, opennlp, Standford parsers. But I can not find them…

pritul panchal
- 13
- 6
1
vote
1 answer
How to combine two sentences using simplenlg
Given a set of sentence like "John has a cat" and "John has a dog" would to create a sentence like "John has a cat and dog".
Can I use simplenlg to create the same.

Rakesh.P
- 183
- 1
- 2
- 11
0
votes
0 answers
Causality with complement in SimpleNLG not working as intended
I am trying to use SimpleNLG (using python and simplenlg) to generate phrases using the word "because".
The wiki (https://github.com/simplenlg/simplenlg/wiki/Section-XIII-%E2%80%93-Generating-a-sentence-with-multiple-clauses) offer the following…

MeddlingRacc
- 1
- 1
0
votes
0 answers
How to get SimpleNLG to provide the proper definite/indefinite determiner for a word?
I'd like to tell Simple NLG a word like "apple" or "water" and then only tell it abstractly that I want a "definite" determiner like "the" or an indefinite one like "a/an" and have it pick the right one. For example:
[definite] apple = "the…

Eric Zinda
- 787
- 7
- 15
0
votes
1 answer
How to get subject pronoun with SimpleNLG?
val lexicon: Lexicon = Lexicon.getDefaultLexicon()
val realised: Realiser = Realiser(lexicon)
val word: WordElement = lexicon.getWord("I", LexicalCategory.PRONOUN)
val inflected = InflectedWordElement(word)
inflected.setFeature(Feature.PERSON,…

Kokoro
- 3
- 4
0
votes
1 answer
How do I realize a possessive pronoun using the SImpleNLG server?
My XML looks like this:
hand
…

Greg Wickham
- 1
- 3
0
votes
1 answer
Can't apply method addComplement on an NLGElement
I see from this documentation that we can apply the method addComplement on an NLGElement, but when I try this code:
Lexicon lexicon= new XMLLexicon();
NLGFactory factory = new NLGFactory(lexicon);
NLGElement s1 = factory.createSentence("my dog is…

mee
- 688
- 8
- 18
0
votes
1 answer
How to find features of a word variant (using SimpleNLG)?
My idea is to, given a word variant and a base form from another word, reproduce the features from the word variant in the base form.
I've been able to produce a word variant from a base form given a set of features, my problem lies on gathering…

correia55
- 81
- 1
- 3
- 10
0
votes
1 answer
TextSpec in SimpleNLG Model is not available
I am looking to combine two sentences using the TextSpec Class as mentioned in the link: https://code.google.com/p/simplenlg/wiki/Section16 . But looks like the class is no longer available. Could someone please guide me on this?

Gayatri
- 2,197
- 4
- 23
- 35
-3
votes
2 answers
TypeError: 'NLP' object is not callable
Here's the Site
From here i just try to ran the sample code provided on site, but am getting this error
TypeError Traceback (most recent call last)
in
----> 1 text = nlp("The virginica species has the least…

Thirumalai vasan
- 655
- 2
- 6
- 19