Giter Club home page Giter Club logo

bertnlpdbpediainterface_swift's Introduction

BertNlpDbpediaInterface

work in progress - please visit later

The BERT NLP model and code is taken directly from Apple's example described at:

https://developer.apple.com/documentation/coreml/finding_answers_to_questions_in_a_text_document

Apple's BERT model and code are licensed under the Apache 2 license.

The Swift SPARQL query code is taken from the earlier material in my book Artificial Intelligence Using Swift.

Note: I modified two of Apple's demo files: BERT.swift and BERTVocabulary.swift

I added a command line test in main.swift

Setup

You must copy two data files from the Apple Dev example project:

  • bert-base-uncased-vocab.txt
  • BERTQAFP16.mlmodel

by downloading Apple's example project (which you will want to run anyway - it has a UI, the example here is a command line application):

https://docs-assets.developer.apple.com/published/63ddeb54cb/FindingAnswersToQuestionsInATextDocument.zip

Copy the two data files into the subdirectory Sources/BertNlpDbpediaInterface/Resources. After copying these files, this project should look like:

{linenos=off}

├── Package.swift
├── README.md
├── Sources
│   └── BertNlpDbpediaInterface
│       ├── BERT.swift
│       ├── BERTInput.swift
│       ├── BERTOutput.swift
│       ├── BERTQAFP16Input.swift
│       ├── BERTVocabulary.swift
│       ├── Resources
│       │   ├── BERTQAFP16.mlmodel
│       │   └── bert-base-uncased-vocab.txt
│       ├── SparqlQuery.swift
│       ├── TokenizedString.swift
│       └── main.swift
└── Tests
    ├── BertNlpDbpediaInterfaceTests
    │   ├── BertNlpDbpediaInterfaceTests.swift
    │   └── XCTestManifests.swift
    └── LinuxMain.swift

bertnlpdbpediainterface_swift's People

Contributors

mark-watson avatar

Stargazers

Yellowflash avatar ebigram avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.