Code verification and attribution using semantic analysis
AssigneeInternational Business Machines Corporation
InventorsGennaro Anthony Cuomo, Lucia Larise Stavarache, Blaine H. Dolph, Trent A. Gray-Donald
Life of this patent
Estimating the term…
Abstract
Systems and methods are provided for attributing source code, including ingesting source code from a plurality of repositories, normalizing the ingested source code using abstract syntax trees (ASTs), and converting the normalized source code into vector embeddings that represent syntactic and semantic features of the source code. Unique fingerprints are generated from the vector embeddings, the fingerprints are compared against a vector database to identify potential matches and verify code attribution, and feedback and alternative code suggestions are provided based on the comparing the fingerprints.
Claims25
A method for attributing source code, comprising:
- ingesting source code from a plurality of repositories;
- normalizing the ingested source code using abstract syntax trees (ASTs);
- converting the normalized source code into vector embeddings that represent syntactic and semantic features of the source code;
- generating unique fingerprints from the vector embeddings;
- comparing the fingerprints against a vector database to identify potential matches and verify code attribution;
- and
- generating feedback and alternative code suggestions based on the comparing the fingerprints.
A system for attributing source code, comprising:
- a processor device;
- and
- a memory storing instructions that, when executed by the processor device, cause the system to:
- ingest source code from a plurality of repositories;
- normalize the ingested source code using abstract syntax trees (ASTs);
- convert the normalized source code into vector embeddings that represent syntactic and semantic features of the source code;
- generate unique fingerprints from the vector embeddings;
- compare the fingerprints against a vector database to identify potential matches and verify code attribution;
- and
- generate feedback and alternative code suggestions based on the comparing the fingerprints.
A computer program product for attributing source code, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a hardware processor to:
- ingest source code from a plurality of repositories;
- normalize the ingested source code using abstract syntax trees (ASTs);
- convert the normalized source code into vector embeddings that represent syntactic and semantic features of the source code;
- generate unique fingerprints from the vector embeddings;
- compare the fingerprints against a vector database to identify potential matches and verify code attribution;
- and
- generate feedback and alternative code suggestions based on the comparing the fingerprints.
A method for enhancing source code verification, comprising:
- ingesting source code from multiple sources;
- normalizing the ingested source code by employing abstract syntax trees (ASTs) to adjust syntactic formats;
- transforming the ingested source code into vector embeddings capable of depicting syntactic and semantic characteristics;
- generating unique code identifiers from the vector embeddings;
- comparing the code identifiers within a vector database to ascertain potential source similarities and verify originality of the source code;
- and
- enhancing code integrity by generating corrective code modifications based on results of the comparing the code identifiers.
A system for enhancing source code verification, comprising:
- a processor device;
- and
- a memory storing instructions that, when executed by the processor device, cause the system to:
- ingest source code from multiple sources;
- normalize the ingested source code by employing abstract syntax trees (ASTs) to adjust syntactic formats;
- transform the ingested source code into vector embeddings capable of depicting syntactic and semantic characteristics;
- generate unique code identifiers from the vector embeddings;
- compare the code identifiers within a vector database to ascertain potential source similarities and verify originality of the source code;
- and
- enhance code integrity by generating corrective code modifications based on results of the comparing the code identifiers.
Dependencies are inferred from the claim text.