Have you ever thought about using social networks and chatbots for collaborative modeling? Well, this is now possible thanks to the work by Sara Pérez-Soler, Esther Guerra, Juan de Lara and Francisco Jurado. Enter the Miso team and their SOCIO modeling bot, one of the best examples of modeling cognification that I’ve ever seen.
Social networks and messaging systems are daily tools in our lives. They have become a popular means to keep in touch with friends everywhere, coordinate and organize activities, and disseminate information. Not only general-purpose social networks like Twitter, Facebook, Whatsapp or Telegram have boosted, but specialized work-team nets like Slack, Workplace by Facebook or Yammer have spread in enterprises. The reason for this success is their agility, simplicity of use, and the possibility to use them everywhere and in mobility, covering the need to stay connected.
Given the widespread use of social networks, and their support for agile coordination and information sharing, we propose to use social networks as front-end for collaborative modelling. On the one hand, using social networks for modelling may foster the active participation of domain experts, which is essential for building high-quality models. On the other hand, like any other collaborative activity, modelling needs mechanisms for discussion, coordination and decision making, which social networks natively provide. If the collaboration is distributed or involves many participants, tool assistance is essential to speed up the process.
In the following, we present SOCIO: a modelling bot integrated in social networks like Telegram and Twitter. SOCIO is an assistant for modelling that interprets domain requirements expressed in natural language (NL) and builds a meta-model (or domain model) out of them. This way, it lowers the entry barrier to domain experts as the interface for modelling is NL, and it fosters their active participation because they do not need to interact with complex or heavyweight modelling editors.
SOCIO integrates seamlessly within the discussion mechanism of social networks, it can be used in mobility, and it does not require installing any dedicated modelling tool. Also, it provides traceability of the provenance of the different model elements, as well as user participation statistics. The constructed models can be validated and exported to EMF format. While the bot has been designed to help in both modelling and meta-modelling, the current version of the tool only supports the creation of meta-models.
In the remainder of this post, we provide details of our approach and tool support. Instructions on how to use the bot are available at https://saraperezsoler.github.io/ModellingBot/. This post is based on our papers [Perez17a][Perez17b].
General Approach of the modeling bot
SOCIO is an assistant for (meta-)modelling tasks. In a modelling session, all participants interact via some social network, like Twitter or Telegram, and the modelling bot integrates seamlessly as another participant. Figure 1 illustrates the interaction between the users and the bot.
Users can interact using the social network of their choice by sending messages to other partners to discuss the model requirements, or to coordinate between them. In addition, to update the meta-model, they can send messages to the bot in NL.
The way to address the bot varies depending on the social network: in Twitter, the message needs to mention the bot user name which is @ModellingBot, while in Telegram, the bot must belong to a telegram group and the commands must start with “/”. To process the text that users type in NL, the bot uses the Stanford NL parser to produce a parse tree where each word is tagged with its role in the sentence, like noun (singular or plural) or verb (past, gerund, past participle, 3rd person singular present, non-3rd person singular present). We have created an extensive set of rules that detect specific phrase structures in the parse tree, extract domain requirements from them, and trigger the necessary model updates to accommodate the requirements.
The extraction rules are based on the work performed by Arora et al. [Arora16] and adapted to our context. We currently consider the following rules:
- Verb to be. Phrases containing this verb may indicate a subclassing relation (e.g., “users can be students or teachers”), the type of a feature (e.g., “price is double”) or the abstractness of a class (e.g., “course is abstract”).
- Verb to have (and synonyms). The phrases using this verb identify features (attributes or references) of a class. We also consider the Saxon genitive.
- Verb to contain (and synonyms). Phrases with this verb point the need for a composition relation between two classes (e.g., “an e-learning platform is made of courses”).
- Transitive verbs. When a phrase with a verb, a subject and a direct object is identified, this rule triggers the creation of classes for the subject and direct object, and a reference for the verb.
- Add (and synonyms). Imperative phrases using “add” or a synonym verb result in the creation of classes or features (e.g., “add name to user”).
- Remove (and synonyms). This rule is similar to the previous one, but for removing elements.
Several rules can be applicable to a given sentence. For example, the phrase “an e-learning platform contains courses” can be handled by the “verb to contain” rule, and by the rule for transitive verbs (“an e-learning platform” is the subject and “courses” is the direct object). To handle these cases, the rules have a priority (equals to the position on the previous list) and only the one with highest priority is selected. The selected rule checks the meta-model state and applies the necessary meta-model update actions. If a sentence refers to existing model elements, such elements are not created anew. To provide flexibility and avoid redundancy, SOCIO uses WordNet to detect synonyms. For example, it is possible to refer to an existing class “Teacher” by using “Instructor”.
After the update actions are performed, they can be undone or redone. Supported actions include creating and removing classes, making them abstract or concrete, adding and deleting features, and changing the type of a feature. The message, the user who sent the message and the update actions are stored in a traceability model. This allows analysing the provenance of the different model elements, including their rationale and creators. Moreover, using the information stored, SOCIO generates statistics about the user participation and authorship. Finally, after the message is stored, the bot sends back a picture of the meta-model current status (created using PlantUML), where the changes are highlighted in green and using stereotypes.
As an example, Figure 2 shows several NL messages used to build a meta-model for an e-learning system. The first sentence “courses can be free or paid courses” triggers the “verb to be” rule. The rule identifies all nouns as classes, and adds to the meta-model the ones that do not exist yet (PaidCourse and FreeCourse). In addition, it creates a subclassing relation between Course and PaidCourse, and between Course and FreeCourse. The second sentence “courses are evaluated with a test” triggers the “transitive verbs” rule. As before, the nouns correspond to elements of the meta-model, which are created if they do not exist. In this case, the rule creates the class Test and a reference from Course to Test. The verb becomes the name of the reference.
We have developed a modelling bot, called SOCIO, to support the presented approach. It is currently integrated in Telegram and Twitter, but it has been designed to allow their easy inclusion in other social networks. SOCIO stores the meta-model in Ecore format, and the traceability model as an EMF model. The next video shows its use in Telegram.
Figure 3 illustrates some interactions with SOCIO. In Figure 3(a), the bot shows all available commands, and then one user creates a project using the /newproject command. In Figure 3(b), a user sends a message to the bot, which updates the meta-model and sends back a picture of the updated meta-model (the new elements are shown in green). Figure 3(c) shows a similar interaction in Twitter. In Figure 3(d), a user validates the model using the /validate command, and SOCIO reports there is an error because attribute PaidCourse.price specifies no type. Finally in Figure 3(e), a user fixes the error in PaidCourse.price, validates again the model (this time without errors) and downloads the meta-model – using the /get command – as an Ecore file.
Conclusions and Future Work
We have developed SOCIO, a bot for assisted modelling over social networks. It works over Twitter and Telegram, interpreting NL sentences from different users to create a meta-model in a collaborative way. The assistant seamlessly integrates within the social network and keeps track of the model history and user contributions.
In future works, we plan to support meta-model instantiation, and integrate SOCIO with other social networks and communication mechanisms, like speech recognition using Skype bots.
[Perez17a] Sara Pérez-Soler, Esther Guerra, Juan de Lara, and Francisco Jurado. The rise of the (modelling) bots: towards assisted modelling via social networks. ASE 2017: 723-728. ACM.
[Perez17b] Sara Pérez-Soler, Esther Guerra, and Juan de Lara. Assisted Modelling Over Social Networks with SOCIO. MODELS (Satellite Events) 2017: 561-565.
[Arora16] C. Arora, M. Sabetzadeh, L. C. Briand, and F. Zimmer. Extracting domain models from natural-language requirements: approach and industrial evaluation. MODELS 2016: 250–260. ACM.