wit icon indicating copy to clipboard operation
wit copied to clipboard

Is it possible / will it be possible to copy or duplicate stories?

Open agrey opened this issue 9 years ago • 9 comments

I've created a story with a series of complex decision trees for questions and answers. I would like to create a second story which is structurally similar but with variations in the content.

I would like to be able to duplicate an existing story as a starting point for the next one, so that I can then go through the story and change the key words instead of building the whole thing from scratch. It would save a lot of time this way. I realize it would have a lot of errors initially as all of the conflicts are detected, but that's fine. Those would go away as I went through the story and modified it as planned.

Is it possible to do this?

agrey avatar Mar 29 '17 17:03 agrey

You can create a backup of your app in the story settings. Then create a new app, and choose "import" and select the zip file you just loaded. After a moment or two you'll have a duplicate of your app.

hactar avatar Mar 29 '17 18:03 hactar

Thanks hactar!! :)

agrey avatar Mar 29 '17 18:03 agrey

I just tried this and it didn't address my original question actually. I don't want a duplicate app. I want to duplicate the story within a single app. So for example, I have a complex story that uses language for a male. I want to duplicate that story using language that assumes the user is a female... and I don't want to manually recreate the whole story line because it was incredibly complex. I would like to duplicate the male version, and then crawl through it and just change a word here and there to adjust it for female pronouns etc.

agrey avatar Apr 04 '17 17:04 agrey

Duplicate of #457.

cpf-sh avatar Apr 04 '17 17:04 cpf-sh

Technically 457 is a duplicate of 449 which I initiated first ;) I also have additional details here not mentioned in 457, which may be helpful. For instance, I'm trying to solve this by exporting and duplicating a story in the .json file, then using 'sed' to find and replace strings... then importing the result back in. If it works, I will post back here with the update.

agrey avatar Apr 04 '17 17:04 agrey

All the same thing really @agrey :P I had thought about doing a find/replace jobby in the JSON myself, but decided it was too much effort. There should be a GUI option for it.

cpf-sh avatar Apr 04 '17 17:04 cpf-sh

Agreed - there should be a GUI option for it! In the meantime, this is what I'm trying... maybe this will be helpful to others:

sed -i 's/(.)son(.)/\1daughter\2/' sed -i 's/(.)guy(.)/\1girl\2/' sed -i 's/(.)he(.)/\1she\2/'

agrey avatar Apr 04 '17 17:04 agrey

I ended up copying the story out of stories.json into temp.rtf. Then I went with:

find temp.rtf -type f -exec sed -i "" "s/he/she/g" {} ; find temp.rtf -type f -exec sed -i "" "s/boy/girl/g" {} ;

... etc for the various substitutions he -> she, boy -> girl, etc. This worked.

I copied the modified story into the original stories.json file, saved it, compressed the folder, and tried to upload back into Wit but received a mysterious error (giant exclamation point with no further details). I changed the name of the previous app to make sure it wasn't just an app name conflict. Maybe something about the duplicate story in the stories.json file is producing the conflict? Some guidance from above would be helpful here.

Update: also tried to just copy the story internally within the stories.json file without making any substitutions (so the same story should show up twice in the app, and I figured worst case I would just crawl through the app in the GUI and make my changes one at a time that way). However, this also triggered the mysterious error (giant exclamation point with no further details, when I try to upload the app)

agrey avatar Apr 04 '17 19:04 agrey

Closing since we will stop Stories and serving requests to the associated /converse endpoint on February 1, 2018: https://wit.ai/blog/2017/07/27/sunsetting-stories

l5t avatar Jan 22 '18 01:01 l5t