rali-udem / jsrealb Goto Github PK
View Code? Open in Web Editor NEWA JavaScript bilingual text realizer for web development
License: Apache License 2.0
A JavaScript bilingual text realizer for web development
License: Apache License 2.0
I tried to run UDregenerator in Colab. When I ran
!node variationsFromText.js file.txt
I met following errors.
*** Creating file.conllu
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn ./text2ud.py EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -13,
code: 'EACCES',
syscall: 'spawn ./text2ud.py',
path: './text2ud.py',
spawnargs: [ 'en', 'file.txt' ]
}
What do these information mean? How could I fix with it?
Build size is huge.
Consider having separate code for English & French?
Would that help?
Guy
I modified the function generateQuestion
and generateQuestions
in variationsFromText.js
as follows.
function generateQuestion(jsr, typ){
const question=jsr.clone().typ({"int":typ});
console.log(fmt,typ.toUpperCase()+" ",clean(question.toString()));
nbQuestions++;
}
function generateQuestions(jsr){
const subjIdx=jsr.findIndex(d=>d.isA("subj"));
let jsr1=jsr.clone();
jsr1.terminal.setProp("n","s");
jsr1.terminal.setProp("pe",3);
generateQuestion(jsr1, "was");
generateQuestion(jsr1, "wad");
generateQuestion(jsr1, "wod");
generateQuestion(jsr1, "whe");
generateQuestion(jsr1, "why");
generateQuestion(jsr1, "whn");
generateQuestion(jsr1, "how");
}
In this way, I would like to test if Unregenerator can generate 7 types of questions as above. By modifying variationsFromText.js
, I just ignore the answer of each question.
The input sentence is
Cat loves the mouse in the park.
When I ran variationsFromText.js
, the results were as follows.
*** Creating file.conllu
*** Wrote file.conllu
# id = 1.0
# text = Cat loves the mouse in the park.
# TEXT = Cat loves the mouse in the park.
# WAS = What loves the mouse in the park?
# WAD = What does cat love in the park?
# WOD = Who does cat love in the park?
# WHE = Where does cat love the mouse in the park?
# WHY = Why does cat love the mouse in the park?
# WHN = When does cat love the mouse in the park?
# HOW = How does cat love the mouse in the park?
1 UD dependencies processed
7 questions
From my perspective, in whe
manner, in the park
should not appear in the question. Could I do something to make this possible? Also, if I add other prepositional phrases in the sentence, the PP will appear in the question. Could I delete PP in the question?
Kunze
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.