Text to P&ID aims to convert a process description to P&ID.
The process is as follows:
We can extract equipment/instruments from the process description using a Natural Language Processing library. This allows us to detect equipment in the process description and understand the interrelations.
We use Neo4j as a graph database to store the relational information.
We can connect to Neo4j using the py2neo
Python library.
To install py2neo
, run:
pip install py2neo
This repo contains an initialization script (src/initialize-neo4j.py
) which connects to a local instance of Neo4j and adds equipment; instruments; relations between them (FLOWS_TO
and MEASURES
).
Neo4j connection configuration can be changed in src/config.py
.
This will involve enumerating through different position values such that the generated P&ID complies with the required standards, and is as efficient as possible.
DEXPI (Data Exchange in the Process Industry) is an open standard for data exchange, based on XML, allowing for interoperability between vendors.
Based on the data obtained in the previous steps, we can use the xml
Python library to create an XML file, in accordance with the DEXPI standard.
We can define rules using a Cypher statement and query the Neo4j database to ensure that the P&ID is compliant.
An example of this can be seen in src/rule-based-validation.py
.
The content of the README is distributed under the CC0 1.0 Universal license. The code in Text to P&ID is distributed under the MIT license.
We at PlantFCE are creating a pipeline that enables us to go from process description to P&ID.
Annotate and digitize your P&IDs with PlantFCE eAI. Learn more →