GitXplorerGitXplorer
c

sdcg

public
7 stars
3 forks
2 issues

Commits

List of commits on branch master.
Unverified
56b20e93301cd3647640e5802bd45cdae00d6d6b

Merge pull request #1 from saraswat/master

ccth committed 8 years ago
Unverified
b01fac2854c850500bd8d2e63b2f49f722cba3ba

Fixed the tests so that they are aligned with the output of sdcg. Also removed gratuitous obfuscation in tests. Removed a predicate definition in utils that is now pre-defined in B-Prolog.

committed 8 years ago
Unverified
3e48a8b9e2f7d41aaacb08c42297acd9c4f73a71

Update README.md

ssaraswat committed 8 years ago
Unverified
2f43cc93aa2eec7faf05da88f72c639bbbb649d5

Update and rename README to README.md

ssaraswat committed 8 years ago
Unverified
8c60bbc0eadb189028cb5103d79d417e4cd44892

updated todo list

committed 16 years ago
Unverified
06f4d3353a739c7d7011da542a90e71146184da2

changes

committed 16 years ago

README

The README file for this repository.

Stochastic Definite Clause Grammars

SDCG is a compiler which compiles from an extended version of Prologs DCG syntax to a stochastic program expressed using the amazing PRISM system.

It is intended to be used for natural language parsing which requires something a bit more expressive than stochastic context-free grammars.

Sample run

The Prism system should be installed first. Prism uses B-Prolog. (This code does not run on SWI-Prolog.) Then run prism, and load grammar files, e.g.

% cd grammars/report_simple
% prism
PRISM 2.2, (C) Sato Lab, Tokyo Institute of Technology, September, 2015
B-Prolog Version 7.8b1, All rights reserved, (C) Afany Software 1994-2012.

This edition of B-Prolog is for evaluation, learning, and non-profit
research purposes only, and a license is needed for any other uses.
Please visit http://www.probp.com/license.htm for the detail.

Type 'prism_help' for usage.
| ?- [load].
...
| ?- train_with_parsetree.
train_with_parsetree.
#goals: 0(4)
Exporting switch information to the EM routine ... done
#em-iters: 0(9) (Converged: -9.773285894)
Statistics on learning:
        Graph size: 63
        Number of switches: 5
        Number of switch instances: 11
        Number of iterations: 9
        Final log likelihood: -9.773285894
        Total learning time: 0.003 seconds
        Explanation search time: 0.000 seconds
        Total table space used: 25784 bytes
Type show_sw to show the probability distributions.
Switch n(1): unfixed_p: n_1_2 (p: 0.400000540) n_1_1 (p: 0.599999460)
Switch np(1): unfixed_p: np_1_2 (p: 0.749998876) np_1_1 (p: 0.250001124)
Switch s(1): unfixed_p: s_1_2 (p: 0.999998876) s_1_1 (p: 0.000001124)
Switch v(1): unfixed_p: v_1_3 (p: 0.500000562) v_1_2 (p: 0.250000281) v_1_1 (p: 0.249999157)
Switch vp(1): unfixed_p: vp_1_2 (p: 1.000000000) vp_1_1 (p: 0.000000000)

yes
| ?- testit.
testit.
time_flies-0.112497
time_time-3.84627e-07

yes
| ?- 

Files

  • compiler/
    • Contains the code of the SDCG compiler
  • util/
    • Contains various utilities of used by the compiler
  • test/
    • Contains unit-tests for the compiler
  • misc/
    • Various stuff
  • grammars/
    • Some example grammars