<commit_before># FREyA
FREyA - a Natural Language Interface for Querying Ontologies

FREyA is an interactive Natural Language Interface for querying ontologies which combines usability enhancement methods such as feedback and clarification dialogs in order to:
1) improve recall by generating the dialog and enriching the domain lexicon from the user's vocabulary, whenever an "unknown" term appears in a question
2) improve precision by resolving ambiguities more effectively through the dialog. The suggestions shown to the user are found through ontology reasoning and are initially ranked using the combination of string similarity and synonym detection. The system then learns from the user's selections, and improves its performance over time.

FREyA Web Site:
https://sites.google.com/site/naturallanguageinterfaces/freya


 Install FREyA
--------------------------------------------------------------------------------
1. Prepare your repository: you can use sesame workbench to set up a Sesame SPARQL endpoint or you could use OWLIM:
[Setting up OWLIM repository using Sesame Workbench (http://researchsemantics.blogspot.co.uk/2012/03/set-up-your-own-sparql-endpoint-with.html)

2. Check out the FREyA code

cd to the dir where you want to check out the freya project e.g. 

cd ~/projects

git clone https://github.com/danicadamljanovic/freya freya

Quickstart Freya (using Mooney geography)
--------------------------------------------------------------------------------

1. Update freya.properties to point to your repositoryURL and repositoryId.
   - you can find mooney ontology in freya-annotate/src/main/resources/ontologies/mooney folder
   - it is recommended to use owlimlite with owlimhorst when setting up repository
2. mvn clean install -DskipTests will create war file in freya-annotate/target directory and skip running all tests
3. Copy war file into your tomcat webapps folder and start tomcat.
4. Open it: http://localhost:8080/freya


Using freya with other ontologies
--------------------------------------------------------------------------------

1. Configure freya.properties to point to the right repositoryURL and repositoryId
2. Open the homepage of freya at: http://localhost:8080/freya
and click 'Reindex' (or point your browser to http://localhost:8080/freya/service/solr/reindex)


Setting up SOLR:
--------------------------------------------------------------------------------

Download Solr 4.6 Recommended version: http://lucene.apache.org/solr/downloads.html

unpack SOLR and go to example dir

Copy conf file from freya-annotate/src/main/resources/solr into relevant dir -> example/solr/collection1/conf 


Reindexing SOLR:
----------------------------------------
If for any reason you want to wipe out the SORL index and build it again, the best way to do this is as follows:

1. Start up your solr
2. Start up Freya platform
3. Call **Reindex** from the Freya home page

By clicking the **reindex** link, the existing index will be automatically removed, and you will be able to see the reindex processing in a new browser window.



What types of natural language queries are supported by FREyA?<commit_msg>added cleaning up the solr index note<commit_after># FREyA
FREyA - a Natural Language Interface for Querying Ontologies

FREyA is an interactive Natural Language Interface for querying ontologies which combines usability enhancement methods such as feedback and clarification dialogs in order to:
1) improve recall by generating the dialog and enriching the domain lexicon from the user's vocabulary, whenever an "unknown" term appears in a question
2) improve precision by resolving ambiguities more effectively through the dialog. The suggestions shown to the user are found through ontology reasoning and are initially ranked using the combination of string similarity and synonym detection. The system then learns from the user's selections, and improves its performance over time.

FREyA Web Site:
https://sites.google.com/site/naturallanguageinterfaces/freya


 Install FREyA
--------------------------------------------------------------------------------
1. Prepare your repository: you can use sesame workbench to set up a Sesame SPARQL endpoint or you could use OWLIM:
[Setting up OWLIM repository using Sesame Workbench (http://researchsemantics.blogspot.co.uk/2012/03/set-up-your-own-sparql-endpoint-with.html)

2. Check out the FREyA code

cd to the dir where you want to check out the freya project e.g. 

cd ~/projects

git clone https://github.com/danicadamljanovic/freya freya

Quickstart Freya (using Mooney geography)
--------------------------------------------------------------------------------

1. Update freya.properties to point to your repositoryURL and repositoryId.
   - you can find mooney ontology in freya-annotate/src/main/resources/ontologies/mooney folder
   - it is recommended to use owlimlite with owlimhorst when setting up repository
2. mvn clean install -DskipTests will create war file in freya-annotate/target directory and skip running all tests
3. Copy war file into your tomcat webapps folder and start tomcat.
4. Open it: http://localhost:8080/freya


Using freya with other ontologies
--------------------------------------------------------------------------------

1. Configure freya.properties to point to the right repositoryURL and repositoryId
2. Open the homepage of freya at: http://localhost:8080/freya
and click 'Reindex' (or point your browser to http://localhost:8080/freya/service/solr/reindex)


Setting up SOLR:
--------------------------------------------------------------------------------

Download Solr 4.6 Recommended version: http://lucene.apache.org/solr/downloads.html

unpack SOLR and go to example dir

Copy conf file from freya-annotate/src/main/resources/solr into relevant dir -> example/solr/collection1/conf 


Reindexing SOLR:
----------------------------------------
If for any reason you want to wipe out the SORL index and build it again, the best way to do this is as follows:

1. Start up your solr
2. Start up Freya platform
3. Call **Reindex** from the Freya home page (or call http://localhost:8080/freya/service/solr/reindex from your browser)

By clicking the **reindex** link, the existing index will be automatically removed, and you will be able to see the reindex processing in a new browser window.

In case that you have problems with solr, you can go to it's admin console and view the index. To clean the index completely:
1. In the browser call this command:
http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E
2. Then this command:
-http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E


What types of natural language queries are supported by FREyA?
{'fraction_non_alphanumeric': 0.15722526253512795, 'fraction_numerical': 0.013607454518562342, 'mean_word_length': 2.7379767827529022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2026246', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1668, 'n_words': 800}