More information about the 10 types of information that can be useful for WSD (Word Sense Disambiguation)

Agirre and Martinez (Knowledge Sources for Word Sense Disambiguation) distinguish ten different types of information that can be useful for WSD (Word Sense Disambiguation):

  1. Part of speech (POS) is used to organize the word senses. For instance, in WordNet 1.6 handle has 5 senses as a verb, only one as a noun.
  2. Morphology, specially the relation between derived words and their roots. For instance, the noun agreement has 6 senses, its verbal root agree 7, but not all combinations hold.
  3. Collocations. The 9-way ambiguous noun match has only one possible sense in “football match”.
  4. Semantic word associations, which van be further classified as follows:
    a Taxonomical organization, e.g. the association between chair and furniture. b Situation, such as the association between chair and waiter. c Topic, as between bat and baseball. d Argument-head relation, e.g. dog and bite in “the dog bite the postman”. These associations, if given as a sense-to-word relation, are strong indicators for a sense. For instance, in “The chair and the table were missing” the shared class in the taxonomy with table can be used to choose the furniture sense of chair.
  5. Syntactic cues. Subcategorization information is also useful, e.g. eat in the “take a meal” sense is intransitive, but it is transitive in other senses.
  6. Semantic roles. In “The bad new will eat him” the object of eat fills the experiencer role, and this fact can be used to better constrain the possible senses for eat.
  7. Selectional preferences. For instance, eat in the “take a meal” sense prefers humans as subjects. This knowledge type is similar to the argument-head relation (4d), but selectional preferences are given in terms of semantic classes, rather that plain words.
  8. Domain. For example, in the domain of sports, the “tennis racket” sense of racket is preferred.
  9. Frequency of senses. Out of the 4 senses of people the general sense accounts for 90% of the occurrences in Semcor.
  10. Pragmatics. In some cases, full-fledged reasoning has to come into play to disambiguate head as a nail-head in the now classical utterance “Nadia swing the hammer at the nail, and the head flew off”.

My questions are:

1) Is there other kind of information useful for WSD?

2) I only see disambiguation algorithms using at most three different kinds of information at the same time (for example A Novel Neural Sequence Model with Multiple Attentions for Word Sense Disambiguation). Is there a powerful system/algorithm integrating all those types of information?

Categorisation of GM Types

RPG theory seems to recognise the differences between player interests, and acknowledge a few loose categories thereof – the tongue-in-cheek four in the Munchkin File, expanded to the more seriously-considered seven in Robin’s Laws of Good Game Mastering; there seem to be less formal ways to split the types floating around that are largely similar to the former. And sure, I know the categories are loose approximations etc. etc.; I’m not here to argue the degree to which they are or aren’t to be taken literally.

But in a recent discussion my attention has been attracted to the fact that categorisation of GM types seems less well-known, yet one can’t just transplant player categories to GM categories because of how radically different the roles are. So my question is, what should I read if I want to acquaint myself with what recognised types of GMs are there and how they differ in terms of preferred techniques, goals etc.?

I don’t care if it’s a book/PDF, an article, or even an answer posted right here because the original source is lost, so long as it can help me out to learn what RPG theory has to say about GM types. I prefer an introductory source/answer, but if that’s unavailable, am willing to try a more complex source instead.

How to avoid duplication of types in MVVM

I’m learning the MVVM pattern and something that comes up often is a duplication of data-types.

Say I have a Person datatype. Intuitively I want it to look like this:

public class Person {     public string FirstName { get; set; }     public string LastName { get; set; }     public uint Age { get; set; } } 

But instead, the code will have a PersonViewModel a PersonModel class and in many cases there’s also a PersonData class which is used for serialization.

A PersonViewModel inherits from a base class for ViewModels and the setters will have RaisePropertyChanged calls.

public class PersonViewModel: ViewModelBase {     private string _firstName;      public string FirstName     {         get         {             return _firstName;         }         set         {             _firstName = value;             OnPropertyChanged("Person");         }     }     ... } 

A PersonModel does not call OnPropertyChanged and does not inherit from ViewModel. Also one of the reasons for this is to not bind the view to the model directly, rather to bind it to a ViewModel.

A PersonData will have the same properties but they’ll be marked with the DataMember attribute and the class will have the DataContract attribute.

I have 2 questions:

1) Is it really necessary to have so many classes for the same data type? They usually have the exact same properties. Is it not better to just have one class per data type?

2) One of the problems is that changing one class requires you to change the other classes as well. I thought about using an interface that looks like this:

public interface IPerson {     public string FirstName { get; set; }     public string LastName { get; set; }     public uint Age { get; set; } } 

and have the 3 classes implement the interface. If indeed all these classes are necessary is it a good solution for the consistency problem?

3) Is the distinction between “Model” and “ViewModel” really necessary in the data-types level? Sure I can understand why it’s a good idea to have one unit of code be responsible for invoking commands, presenting data, etc… and have another unit of code be responsible for the business logic, but is it really necessary when we’re dealing with data types that are being used across the entire codebase?

Using Null/None/Nil vs empty data types

This question is more coding style related which is why this question is asked here.

I’m new to Python, coming from PHP. I’ve been looking through Ptyhon style guides & code examples, I’ve noticed the None data type is used where I wouldn’t use it.

I always avoid using the None/Null data type. I always like to keep everything (variable types, param types, property types, return types) in the one data type that they’re supposed to be. And so instead of using None, I prefer to have an empty data type (That equates to falsy), so:

For strings: ''

For lists: []

For dicts: {}

For bools: True/False

For ints: 0 if only positive ints expected. -1 if 0 or positive ints are expected. None if any ints (positive, negative, 0) are expected.

For floats: 0.0 if only positive floats expected, otherwise None.

With ints, if I use -1 for default params, then -1 is viewed as the empty int (instead of 0) and will be checked explitly using:

if my_var == -1:     #... my_var is empty 

Here is an example using None as the defaults:

def my_function(my_string=None, my_list=None, my_number=None, my_bool=None, my_dict=None):     """     Defaults params are all None.     Could return list or None.     """     # Return [1, 2, 3] if all args are truthy, otherwise return None     if my_list and my_number and my_string and my_bool and my_dict:         return [1, 2, 3]     else:         return None 

This is how I would prefer to write the above by using empty data types:

def my_function(my_string: str = '', my_list: list = [], my_number: int = 0, my_bool: bool = False, my_dict: dict = {}) -> list:     """     Defaults params are empty data types of the expected data type.     Will always return the one expected datatpe.     Because of this we can always use data type hints everything.     """     # Return [1, 2, 3] if all args are truthy, otherwise return empty list     if my_list and my_number and my_string and my_bool and my_dict:         return [1, 2, 3]     else:         return [] 

Another reason why I like this style is because with PHP, you can add this declaration at the top of all files:

declare(strict_types = 1);

What this does is if using type hints in functions/methods it will throw a TypeError if the wrong data type is passed (this is somewhat equivalent to writing out throw exceptions at the start of the function by throwing a wrong data type exception if the passed arg is the wrong data type).

I would like to know people’s views about these two coding styles.

how to create a custom xml export for custom post types

I can’t find any typical ‘wordpress’ way of using wordpress’ XML exporter (that it uses to export xml for posts and custom post types etc) to specifically export an XML structure custom post types that you specify. Basically I don’t want the exported xml in the format wordpress gives. I want it in this format: and I want the xml accessible from some endpoint on the url. (e.g. – obviously i need a cron that updates that xml file or something similar.

is there a wordpress function that uses the existing xml export to do this or is it a job of creating my own (to do this I’d probably create some multidimensional array, keys will be xml key names i want and the values will just be populated by the database and i’ll recursively add new arrays based on amount of posts etc.)

Error ‘Mismatch of data types….’ printed during data migration to Magento 2

The following error was output during data migration to Magento 2.

If you receive such an error, which file would you like to edit?

Also, please tell me how to write.

Mismatch of data types. Source document: paygent_last_id. Fields: payment_notice_id Mismatch of data types. Source document: sales_flat_order. Fields: shipping_description  Mismatch of data types. Destination document: paygent_last_id. Fields: payment_notice_id Mismatch of data types. Destination document: sales_order. Fields: shipping_description 

Is Project Image immune to any types of damage?

The spell Project Image states:

The illusion looks and sounds like you but is intangible.

and also

If the illusion takes any damage, it disappears, and the spell ends.

Does the intangibility of the illusion imply immunity to one or more damage types? As an example, one might imagine that damage based on having a tangible physical thing to hurt, like non-magical bludgeoning damage, may not apply.

Are REST Resources and GraphQL Object Types conceptually equal?

I’m in the process of outlining the intended business logic of a web service. At this point, I’m not too concerned with implementation details. On the contrary, I’m looking for ways to abstract them away in order to describe the business logic and data exposed by the web service in an implementation-agnostic manner.

I’ve read a little about the fundamental principles behind REST and GraphQL. RESTful services expose resources. GraphQL exposes data using Object Types.

These concepts share some core characteristics:

  • they describe ‘things’ (entities) with attributes
  • ‘things’ can be related to other ‘things’
  • ‘things’ support a uniform interface to interact with them: retrieval, insertion, mutation and deletion (at least to some degree; I’m not familiar with mutations in GraphQL)

I might be mixing up some terms, but am I overall correct in thinking both are conceptually equal or at least very similar?

Is the omission of implementation details from the documentation an adequate means of ‘bridging the gap’ between the two (and possible future variations)?

Are there standards for documenting the ‘things’ and the behaviour of their supported operations in an implementation agnostic manner?

terminal – count how many types of (file) extensions exist with their associated files in current directory

I’ve about 0.1 million images in a directory with all kinds of extensions (gif, jpeg, png, tiff, etc).

Now I want to find out how many types (of extensions) are there in the current directory, possibly with total number of images associated with them using a terminal command, something like this:

some-command  png  - 11010 jpeg - 1134 jpg  - 145 tiff - 555 

P.S: I do not want to count files with specific extension but rather want to count types of extensions with their associated files.